Qt 5.6 - qt.labs.controls - ApplicationWindow width / height


  • Qt Champions 2016

    UseCase: mobile APP Development for Android / iOS using TechPreview of new QtQuickControls2
    There's a specific Gallery Example demonstrating use of qt.labs.controls
    http://doc.qt.io/qt-5/qtlabscontrols-gallery-gallery-qml.html

    ApplicationWindow from qt.labs.control namespace is defined this way:

    ApplicationWindow {
        id: window
        width: 360
        height: 520
        visible: true
        title: "Qt Labs Controls"
    

    My qestion is about the width and height

    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 will give me correct size and also changes if rotating from portrait to landscape:

    main.cpp:
    context->setContextProperty("myScreen", qApp->primaryScreen());
    
    QML:
    width: myScreen.size.width
    

    If this is recommended next question: should I use myScreen.availableSize.width instead of myScreen.size.width

    thx for infos



  • 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


  • Qt Champions 2016

    @jpnurmi thx forthe info. then I will remove this for mobile app development



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.