Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.12, 6.5.0
-
None
-
Windows 11
Description
When a ComboBox popup menu goes up instead of down, it does not align with the ComboBox if the ComboBox scale is something other than 1.
It's pretty cool that the ComboBox popup menu automatically avoids extending outside the window frame, but it looks pretty ugly when the Item it's on is scaled proportionally to the window size. Run the attached code and drag the window larger; the control itself looks fine but the menu does not scale correctly at all. As you get close to 1:1 scaling, the menu lines up but is you shrink the window smaller than 1:1 it misaligns in the opposite direction.
// main.qml in attached 7z file ApplicationWindow { id: window width: 320; height: 240 visible: true title: qsTr("ComboBox Scale Defect") Rectangle { anchors.centerIn: parent width: 180; height: 180 color: "lightblue" scale: window.height/height // scale proportionally to window height ComboBox { id: comboBox anchors.bottom: parent.bottom model: [ "one", "two", "three" ] // popup.scale: parent.scale // fixes popup's font size, but not position Component.onCompleted: popup.open() } } }
I see two issues when ComboBox scale is not 1:
- popup menu does not align with top of ComboBox
- this is the focus of this issue
- popup menu is not scaled to match ComboBox
- workaround is simple: popup.scale: parent.scale