Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML Screen incorrect properties at application start up



  • I need correct screen sizes at start but if i do this code:

    @import QtQuick 2.0
    import QtQuick.Window 2.0

    Rectangle {

    MouseArea {
        anchors.fill: parent
        onClicked: {
            console.log( Screen.height, Screen.width, Screen.desktopAvailableHeight, Screen.desktopAvailableWidth);
        }
    }
    
    Component.onCompleted: {
        console.log( Screen.height, Screen.width, Screen.desktopAvailableHeight, Screen.desktopAvailableWidth);
    }
    

    }
    @

    i have zeros at start
    and correct screen sizes at mouse click

    @0 0 0 0
    1200 1920 1133 1920@

    How can tell what is this?
    And how i can get correct screen sizes at start of application?




Log in to reply