August 25, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

Getting screen information in both desktop and mobile

 

Hi to all,

In the recent Qt-Quick components (released starting from Qt 4.7.3) there is the QML screen element. Instead the other components i.e. the common toolbar this seems to be usable only on symbian devices. Is there some class or method or some other else to get the current screen size, pixel density, resolution etc while working on desktop applications?

P.S. it is obvious that in the case of the desktop one of the elements that can be used instead the screen element should be the current main window size, but it is a bit different because the screen element includes information about density, device class etc.

Many thanks.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

2 replies

August 30, 2011

Cayan Cayan
Lab Rat
32 posts

AFAIK: QApplication::desktop() is the only class related to that, for pixel density info you may try using some OS functions.

August 30, 2011

Alicemirror Alicemirror
Lab Rat
717 posts

Many thanks! I think that this is sufficient.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

 
  ‹‹ Packaging Error: Command ’c:/qtsdk/madde/bin/mad dpkg-buildpackage -nc -uc -us’ failed.Exit code: 127      [solved] How to catch mouse click event on titlebar area of QMainWindow? ››

You must log in to post a reply. Not a member yet? Register here!