[Interest] qt.labs.controls - ApplicationWindow - size
ekke
ekke at ekkes-corner.org
Sat Apr 9 14:34:16 CEST 2016
Am 08.04.16 um 20:56 schrieb Kevin Mcintyre:
> 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
> <mailto: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
> --
>
>
just got response from J-P Nurmi in Forum:
/Qt shows windows fullscreen/maximized [*] by default when appropriate.
Thus, the desired window size specified in the Gallery example does not
make any difference on mobile platforms, but it does on desktop
platforms where apps run in windowed mode./
[*] http://doc.qt.io/qt-5/qstylehints.html#showIsFullScreen-prop
so I will remove the width and heigth from ApplicationWindow for
mobile-only applications.
ekke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160409/0f553c33/attachment.html>
More information about the Interest
mailing list