diff options
author | Richard Moe Gustavsen <[email protected]> | 2023-06-12 10:31:49 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <[email protected]> | 2023-06-15 13:04:56 +0200 |
commit | 8393922e7071221a9c6c0811eb714f20bf4ed02b (patch) | |
tree | 2a8eacb71f9ecbe60ab0a2ba48426c5c29943e6e /tests/manual/wasm/qwasmwindow/qwasmwindow.py | |
parent | b86f368441170b1c4f2ec6d0080367187560861e (diff) |
QComboBox: scroll the popup to the top before positioning it
If the style changes while a popup is open (or about to close),
the popup will change style as well before it's hidden. And
this can result in the popup window briefly ending up smaller
than what it needs to be, in order to fit all the menu items.
In that case, it will show 'up' and 'down' widgets in the
menu that auto scrolls it when hovered. And all this can
happen for a split second while the menu is about to close
(as a result of the user clicking on a menu item).
A bug happens because of this if you click on the last menu
item in the list, and this causes the style to change. In
that case, the 'down' widget will end up directly underneath
the mouse for a split second, which will trigger an auto-scroll
timer to start. This timer will trigger a bit later, after
the popup has been hidden, and scroll the list view a bit down.
The result is that the next time you open the popup, it ends up
at the wrong place on the screen in a failed attempt to center
the current index on top of the combobox.
This patch will make sure that we always scroll the list view
to the top before we start calculating where the popup should
be placed on the screen. Otherwise the geometry ends up wrong
since the popup will anyway be resized (if possible) to fit
all the menu items before it's shown and should therefore not
take scrolling into account.
Pick-to: 6.6 6.5
Fixes: QTBUG-113765
Change-Id: I61b5b832904de471c2303fc67325feec322b1449
Reviewed-by: Axel Spoerl <[email protected]>
Diffstat (limited to 'tests/manual/wasm/qwasmwindow/qwasmwindow.py')
0 files changed, 0 insertions, 0 deletions