[Interest] qt.labs.controls - ApplicationWindow - size

Kevin Mcintyre kebin70 at gmail.com
Fri Apr 8 20:56:46 CEST 2016


This is a question I've been struggling with, while still being able to
launch a desktop version with similar proportions to handhelds.

On Fri, Apr 8, 2016 at 3:43 AM, ekke <ekke at ekkes-corner.org> wrote:

> the Gallery example from qt.labs.controls
> http://doc.qt.io/qt-5/qtlabscontrols-gallery-gallery-qml.html
> defines the ApplicationWindow this way:
>
> ApplicationWindow <http://doc.qt.io/qt-5/qml-qt-labs-controls-applicationwindow.html> {
>     id: window
>     width: 360
>     height: 520
>     visible: true
>     title: "Qt Labs Controls"
>
>
> My question is about the width and height.
>
> I'm using it only for mobile APPs on Android and iOS
>
> On a mobile device the ApplicationWindow always has to fill the entire
> available space,
> so it doesn't make sense to start with a fixed size width / height I think
>
> what's recommended ?
>
> should I remove width and height settings and let Qt calculate without ?
>
> Or should I set the width and height from QScreen ?
> this works:
>
> context->setContextProperty("myScreen", qApp->primaryScreen());
>
>
> and then I can use
>
> width: myScreen.size.width // or better .availableSize.width ?
>
>
> have tested: size is correct and also changes if rotating from portrait to
> landscape
>
> thx for infos
>
> ekke
> --
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160408/19b462aa/attachment.html>


More information about the Interest mailing list