Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12
-
Left primary screen 2560x1440 100% scale
Right secondary screen 3840x2160 200% scale
Description
Users have observed that QML windows receive an incorrect size when using the setGeometry function on the QtQuick window object.
Qt Support tested with:
Left primary screen 2560x1440 100% scale
Right secondary screen 3840x2160 200% scale
Empty default QtQuick template project with AA_EnableHighDpiScaling enabled.
Following code was added:
visible: false//or true Button { text: "Fix the size" onClicked: { var rect = Qt.rect(2560+100, 100, 200, 200) root.setGeometry(rect) console.log("width",root.width," height",root.height) } } Component.onCompleted: { //2560 to first screen resolution at Qt support var rect = Qt.rect(2560 + 100, 100, 200, 200) root.setGeometry(rect) root.visible = true console.log("width",root.width," height",root.height) }
Depending on initializing visible value 5.12.4 and 5.12.6 gave different width/height values on Component.onCompleted root.setGeometry(1stwindow.w+100,100,200,200):
false, Qt 5.12.4: Size same
false, Qt 5.12.6: half size
true, Qt 5.12.4: 4x size
true, Qt 5.12.6: 2x size
With the button press the window was set to the 200% screen with given width and height but the scale of the title bar is equal of 100% scaling.
Example project attached.