[Qt-interest] Is there any mapping mode support in Qt Graphics Framework to map logical co-ordinates to physical co-ordinates

Sean Harmer sean.harmer at maps-technology.com
Tue Jan 11 10:17:59 CET 2011


Hi,

On Tuesday 11 January 2011 06:30:52 AK wrote:
> Say my screen has a resolution of 92 DPI. I want to have 1000 logical
> points per inch. So that even at 10 times zoom User can manipulate each
> logical point.
> How can I achieve this in Qt?
> 
> In MFC its pretty straightforward. One has to select appropriate mapping
> mode for device context. For above case one has to select MM_HIENGLISH.

One option is to set a root item for your graphics scene and then set a scale 
transformation on this item to achieve the logical scale that you need.

If all other items in your scene are children of this root item you can then 
use the usual mapTo* and mapFrom* functions to get from/to scene logical 
coords to/from physical coords.

Cheers,

Sean



More information about the Qt-interest-old mailing list