Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.13, 6.2.8, 6.4.3, 6.5.0
-
8393922e7 (dev), 2aa031353 (6.5), 1b8665308 (6.6)
Description
Steps to reproduce
- Build and run the Widget Gallery Example (https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/gallery )
- Select each available "Style" from the combobox in turn.
- For each selected style, click on the combobox's down-arrow to bring up the popup and then click on the same spot again to dismiss the popup.
Expected behaviour (most non-Fusion styles)
After clicking on the down-arrow to bring up the popup, clicking on the same spot again should dismiss the popup and retain the existing selection.
"windowsvista" style (correct):
"windows" style (correct):
Actual behaviour (Fusion style)
When clicking on the down-arrow to bring up the popup, clicking on the same spot again changes the selection to the item above the existing selection.
This issue occurs because the popup's position is wrong - the wrong item is overlaid onto the combobox's body on the first the first click. However, subsequent clicks do not exhibit this issue – if you dismiss the first Fusion popup by clicking elsewhere on the GUI, the 2nd click will produce a correctly-positioned popup.
"fusion" style, 1st click (wrong):
"fusion" style, subsequent clicks (correct):
Notes
This issue seems to be related to switching from a different style to the Fusion style. It does not seem to occur if the Fusion style is applied at startup:
int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setStyle("Fusion"); QComboBox box; box.addItems({"Alpha", "Bravo", "Charlie", "Delta"}); box.setCurrentIndex(2); // Issue does not occur here box.show(); return app.exec(); }
Attachments
For Gerrit Dashboard: QTBUG-113765 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
484202,6 | QComboBox: scroll the popup to the top before positioning it | dev | qt/qtbase | Status: MERGED | +2 | 0 |
485402,2 | QComboBox: scroll the popup to the top before positioning it | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
485403,2 | QComboBox: scroll the popup to the top before positioning it | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |