[Qt-qml] Application usable area dimensions

henrik.hartz at nokia.com henrik.hartz at nokia.com
Mon Aug 16 20:01:51 CEST 2010


Hi,

you're not looking for http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeview.html#ResizeMode-enum (potentially combined with QWidget::showFullscreen) by any chance? this is what qmlviewer (potentially with -fullscreen) also does for you.

Cheers,
Henrik

On Aug 16, 2010, at 1:34 PM, ext simon.turvey at nokia.com wrote:

> Cool. That'll work. Thanks.
> 
> Still might be useful to have more readily available though. A bit like orientation is available through the 'runtime' property when using the QML viewer.
> 
> -----Original Message-----
> From: qt-qml-bounces at trolltech.com [mailto:qt-qml-bounces at trolltech.com] On Behalf Of ext Romain Pokrzywka
> Sent: 16 August 2010 11:54
> To: qt-qml at trolltech.com
> Subject: Re: [Qt-qml] Application usable area dimensions
> 
> 
> If you have access to the QDeclarativeEngine, you can get that information very easily by importing the QDesktopWidget from QApplication into the qml root context, e.g. :
> 
> 	QApplication app(argc, argv);
> 	QDeclarativeView view;
> 	view.engine()->rootContext()->setContextProperty( "desktop", app.desktop() );
> 
> and then in your qml file e.g. :
> 
> 	Rectangle {
> 		width: desktop.width; height: desktop.height
> 	}
> 
> Cheers,
> Romain
> 
> --
> Romain Pokrzywka | romain.pokrzywka at kdab.com | Certified Qt Software Engineer & Trainer Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions
> 
> On Monday 16 August 2010 10:54:50 simon.turvey at nokia.com wrote:
>> Hi all,
>> 
>> Rather than hard coding the screen size in my QML, is there a way of 
>> retrieving the application usable area? That is, the dimensions 
>> available to the application once system ui furniture has been taken into account?
>> 
>> Regards,
>> 
>> Simon
> 
> _______________________________________________
> 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