[Qt-qml] Screen dimensions
Kai Koehne
kai.koehne at nokia.com
Wed Nov 24 11:58:14 CET 2010
On 11/24/2010 11:54 AM, ext Girish Ramakrishnan wrote:
> You can expose QDesktopWidget::screenGeometry() to the QML engine and
> then access it from the QML. Something like,
>
> engine->rootContext()->setContextProperty("screen",
> QApplication::desktop()->screenGeometry());
>
> And then screen.width and screen.height can be used in the QML.
If your app is automatically resized to fill the full screen available
(default for mixed C++/QML Apps generated by the Qt Quick Application
wizard) the root element size is actually the space you have available.
Regards
Kai
> Girish
>
> On Wed, Nov 24, 2010 at 3:56 PM, Mark Constable<markc at renta.net> wrote:
>> How would I determine the screen dimensions of the
>> device being used from within QML code?
>>
>> Any source examples available?
>> _______________________________________________
>> Qt-qml mailing list
>> Qt-qml at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-qml
>>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
More information about the Qt-qml
mailing list