[Interest] curve’s width in inch on different displays

Portale Alessandro Alessandro.Portale at digia.com
Thu Jan 23 11:00:56 CET 2014


> From: 梁伟钟 [lwz at xdt-inc.com]
> Sent: Thursday, January 23, 2014 10:05
> Subject: [Interest] curve’s width in inch on different displays
>
> Hello,  I would like to set curve's width in inch and make sure it shows the same size on different 
> displays with different resolutions.  How to do it ? Please help ,it's important. Thanks!

Qt reports a screen's dpi value:
   http://qt-project.org/doc/qt-5/qscreen.html#logicalDotsPerInch-prop
...on Qt4, use something like QApplication::desktop()->physicalDpiX()

Then just do:
   curveWidthInPixels = curveWidthInInch * dpi

(This will of course only be precise if the platform reports the correct dpi to Qt)


More information about the Interest mailing list