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<[email protected]>  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
>> [email protected]
>> http://lists.trolltech.com/mailman/listinfo/qt-qml
>>
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt-qml

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to