Qt & iPhone X & The Screen



  • So,
    finally my new iPhone arrived, #hype.
    Naturally I want to my Apps also to run on the new device.

    As expected of Qt, simply compiling with the new ios sdk and copying the files on the device works out of the box without a problem.
    Qt 5.9.2 and ios sdk 11.1 and ios(on Phone) 11.1.2

    But, I'm running in some issues about accessing the whole screen.

    When I first started my app, I was pleasently surprised.

    • In Portait- Mode, My App started right below the "notch" and went all the way down to the edge, with the home indicator on top.
    • In Landscape-Mode, the whole width and the whole height of the screen is filled out, and the notch cuts some part of the screen area of, still ok and expected.

    Now, I want my background to extend, in portait-mode, to the very top, and this is where I run into issues.

    I can't access the top part as valid screen area. I did some testing and the following are my results.

    The issue is my root item. It is by default a QtQuick.Window Window-Item.
    If I use QtQuick.Window version 2.1 or 2.2 or 2.3 I can't access the top part. If I use version 2.0 the top part becomes available, but the bottom part, the one with the "home inducator" becomes inaccessable and black.

    So I thought, ok, lets make it a simple Rectangle. That however results in a complete black screen.
    So I tested a QWidgets app, and those seem to behave like a QtQuick.Window version 2.1 or 2.2 or 2.3 aka Black unaccessable top but screen goes all the way to the bottom.

    At this point, I'm a very confused Panda. 0_1510905849674_ConfusedPanda.png

    Anyone has an idea on how to fix this issue? Or is this something I should, if noone has already done that, bring to the bug tracker and hope for a speedy fix?

    Greetings


  • administrators

    Hi @J-Hilk
    Open a bug at https://bugreports.qt.io/

    And be prepared to act as a guinea pig on any fixes. I am fairly sure the iOS platform people don't have X's yet.



  • Alright, thanks you,
    I did end up filling a bugreport
    to be found here

    I'll let the thread open untill I have a fix/work around.


  • administrators

    @J.Hilk the bug fix might take a while, as everyone is concentrating on the upcoming 5.10 release. Last push for that going on right now.
    But if nothing happens on the bug for a while, add a comment or ping on some channel.



  • @tekojo The issue got just asigned to someone, so my hopes are up ;-)



  • A quick update on this.

    Someone got asigned to it, and theres a workaround, in the in the broader sense of the word.
    There's the Qt::WindowStates flag Qt::MaximizeUsingFullscreenGeometryHint that you can set:

    //QWidgets:
    {
    //e.g. Constructor
    setWindowFlag(Qt::MaximizeUsingFullscreenGeometryHint, true);
    }
    
    
    //QML:
    import QtQuick.Window 2.1 // Import needs to be higher than 2.0
    Window{
        flags: Qt.MaximizeUsingFullscreenGeometryHint
    
        id: window
        .....
    }
    

    now the App fills the whole screen in Portrait-and Landscapemode.

    Tor Arne Vestbø, to whom the ticket was asigned to, says an automatic content margin is in the making, but untill than one has to adjust the UI oneself.

    Tor Arne Vestbø said in QTBUG-64574:

    If you set the Qt::MaximizeUsingFullscreenGeometryHint window flag, the window will also cover the area under the statusbar, etc. But we don't have any APIs to automatically add margins for the inner content, the stuff you don't want under the statusbar, so for now you have to do that manually. I'm working on the latter as we speak.

    I had no idea, that that window flag existed, or was not aktivated by default - on mobile apps.
    I can work with that. The ticket is still open but my problems are solved. I'll close this topic.


Log in to reply
 

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