[MeeGo-dev] Qt physical screen size

David Greaves david at dgreaves.com
Mon Feb 22 16:37:49 CST 2010


Bernd Stramm wrote:
 > I can do this on Qt:
> 
>   QPixmap testMap = QPixmap::grabWindow (QApplication::desktop()->winId());
>   double widthInFingers = testMap.widthMM() / 20.0;
>   double heightInFingers = testMap.heightMM() / 20.0;

/me runs screaming....

You do know that Qt has some of the best docs [0] in the business?

Does it not strike you that a class called QApplication[1] that has a
'desktop()' [2] member may have some useful information [3] about... say.... the
desktop?

David

[0] http://qt.nokia.com/doc/4.6/index.html
[1] http://qt.nokia.com/doc/4.6/qapplication.html
[2] http://qt.nokia.com/doc/4.6/qapplication.html#desktop
[3] http://qt.nokia.com/doc/4.6/qdesktopwidget.html#screenGeometry

-- 
"Don't worry, you'll be fine; I saw it work in a cartoon once..."


More information about the MeeGo-dev mailing list