Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.12.2
-
None
Description
Description
When creating a QQuickWidget, the advertised size from the QML root item is (width, height) despite a scale factor different from 1.
How to reproduce
Take this simple QML:
Rectangle {
id: myId
width: 200
height: 100
}
The advertised size to QQuickWidget is (200,100) as expected and the rectangle is drawn normally.
Now add a scale factor:
Rectangle {
id: myId
width: 200
height: 100
scale: 0.5
}
Observed behavior
We observe that:
- The advertised size to QQuickWidget is still (200,100)
- The rectangle is rendered scaled to 0.5 as expected
- The rectangle is placed at the center of the (200,100) "view".
Even worse with a scale factor of 1.5:
- The rectangle is bigger than the (200,100) "view"
Expected behavior
We expect the advertised size to QQuickWidget will be (100,50), taking into account the scale factor, so there will be no wasted space when scaling down. The same goes for scale factors > 1.