I don't think I knew about show() either, so I have a couple of things to
try. Many thanks!
Tom
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/setting-QgsMapCanvas-size-for-testing-map-tools-tp5273987p5274573.html
Sent from the Quantum GIS - Developer mailing list
On Fri, Jul 01, 2016 at 06:47:16PM +0200, Martin Dobias wrote:
> I think what you are up to is not to find out scale(), but actually
> mapUnitsPerPixel(). Scale in QGIS is calculated as ( extent_width / (
> canvas_width * dpi) ) with some extra conversions involved, see
> QgsScaleCalculator
Hi Tom
On Fri, Jul 1, 2016 at 5:25 PM, Tom Chadwin wrote:
> Hi Martin
>
>
> Martin Dobias wrote
> iface.mapCanvas().geometry()
>> PyQt4.QtCore.QRect(0, 0, 879, 390)
> iface.mapCanvas().viewport().geometry()
>> PyQt4.QtCore.QRect(3, 3, 873, 384)
>
> Ah, OK! I
Hi Sandro
On Fri, Jul 1, 2016 at 6:07 PM, Sandro Santilli wrote:
> On Fri, Jul 01, 2016 at 05:58:57PM +0200, Sandro Santilli wrote:
>> On Thu, Jun 30, 2016 at 10:14:34PM +0100, Barry Rowlingson wrote:
>> > Maybe I've missed something here, but doesn't the canvas resize method
>> >
On Fri, Jul 01, 2016 at 05:58:57PM +0200, Sandro Santilli wrote:
> On Thu, Jun 30, 2016 at 10:14:34PM +0100, Barry Rowlingson wrote:
> > Maybe I've missed something here, but doesn't the canvas resize method
> > set the canvas pixel size? This behaves as expected when run
> > standalone from a
On Thu, Jun 30, 2016 at 10:14:34PM +0100, Barry Rowlingson wrote:
> Maybe I've missed something here, but doesn't the canvas resize method
> set the canvas pixel size? This behaves as expected when run
> standalone from a python prompt.
It does ! Thanks for the pointer.
--strk;
Hi Martin
Martin Dobias wrote
iface.mapCanvas().geometry()
> PyQt4.QtCore.QRect(0, 0, 879, 390)
iface.mapCanvas().viewport().geometry()
> PyQt4.QtCore.QRect(3, 3, 873, 384)
Ah, OK! I didn't know anything about a canvas frame. So, without doing
setFrameStyle(), does canvas.extent()
Hi Tom!
On Fri, Jul 1, 2016 at 1:08 PM, Tom Chadwin wrote:
> Barry Rowlingson wrote
>> Maybe I've missed something here, but doesn't the canvas resize method
>> set the canvas pixel size? This behaves as expected when run
>> standalone from a python prompt.
>>
>> from
Barry Rowlingson wrote
> Maybe I've missed something here, but doesn't the canvas resize method
> set the canvas pixel size? This behaves as expected when run
> standalone from a python prompt.
>
> from qgis.core import *
> from qgis.gui import *
> app = QgsApplication([],True)
> canvas =
Maybe I've missed something here, but doesn't the canvas resize method
set the canvas pixel size? This behaves as expected when run
standalone from a python prompt.
from qgis.core import *
from qgis.gui import *
app = QgsApplication([],True)
canvas = QgsMapCanvas()
canvas.show()
I asked about this a while back, as I could not get a defined canvas size in
my tests. I never found an answer, but never understood why it didn't work:
https://lists.osgeo.org/pipermail/qgis-developer/2015-November/040392.html
Tom
--
View this message in context:
On Wed, Jun 29, 2016 at 04:44:29PM +0200, Richard Duivenvoorde wrote:
> https://github.com/rduivenvoorde/simplesvg/blob/master/src/simplesvg/mapsizer/MapSizerDialog.py#L93
>
> the hard part (I think) is that the exact size of the mapcanvas was
> defined relative to other (parent) widgets, and
On 29-06-16 16:37, Sandro Santilli wrote:
> I'm writing a testcase for bug 13952 [1] and would need a
> way to set the map canvas size so to be able to syntetize
> clicks on pixels with predictable contents. How can it be
> done ?
>
> Beside, I've found an QgsMapCanvas::updateMapSize() method
>
I'm writing a testcase for bug 13952 [1] and would need a
way to set the map canvas size so to be able to syntetize
clicks on pixels with predictable contents. How can it be
done ?
Beside, I've found an QgsMapCanvas::updateMapSize() method
which is declared in the header but never defined (git
14 matches
Mail list logo