QML Screen incorrect properties at application start up
QML and Qt Quick
2
Posts
2
Posters
787
Views
1
Watching
-
I need correct screen sizes at start but if i do this code:
@import QtQuick 2.0
import QtQuick.Window 2.0Rectangle {
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? -
The answers are in the "QML screen docs":http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick-window2-screen.html#details