Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 5.6 - qt.labs.controls - ApplicationWindow width / height
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved QML and Qt Quick
labs.controlsqtquickcontrolsqt 5.6
3 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ekkescorner
    Qt Champions 2016
    wrote on 9 Apr 2016, 11:39 last edited by
    #1

    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

    ekke ... Qt Champion 2016 | 2024 ... mobile business apps
    5.15 --> 6.8 https://t1p.de/ekkeChecklist
    QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jpnurmi
      wrote on 9 Apr 2016, 12:23 last edited by
      #2

      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

      E 1 Reply Last reply 9 Apr 2016, 12:29
      0
      • J jpnurmi
        9 Apr 2016, 12:23

        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

        E Offline
        E Offline
        ekkescorner
        Qt Champions 2016
        wrote on 9 Apr 2016, 12:29 last edited by
        #3

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

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
        5.15 --> 6.8 https://t1p.de/ekkeChecklist
        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

        1 Reply Last reply
        0

        3/3

        9 Apr 2016, 12:29

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved