Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.1
-
None
-
macOS 12.6
-
-
a87408750 (dev), f8b151891 (6.4), 7107b4ae5 (6.4), c95de359b (dev)
Description
Escape key press is somehow propagated to parent dialog when combo box popup is closed with it. As a result, the dialog gets closed.
Consider this code.
#include <QApplication> #include <QComboBox> #include <QDialog> #include <QVBoxLayout> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog w; auto vbox = new QVBoxLayout(); w.setLayout(vbox); auto combo = new QComboBox(); vbox->addWidget(combo); combo->addItems({"A", "B", "C"}); w.open(); return a.exec(); }
Steps to reproduce:
1) run the code
2) click the combo box to open the popup
3) press Escape to close the popup
Actual behavior:
- Dialog is closed.
Expected behavior:
- Only popup is closed but not dialog.
This bug seems to exist only on macOS, everything seems to work well on Windows and Linux.
Attachments
Issue Links
- relates to
-
QTBUG-121023 macOS: Enter in combo-box pop-up closes the whole dialog
-
- Reported
-
For Gerrit Dashboard: QTBUG-108908 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
446453,3 | QComboBox: hide the popup on keypress rather than ShortcutOverride | dev | qt/qtbase | Status: MERGED | +2 | 0 |
446816,2 | QComboBox: hide the popup on keypress rather than ShortcutOverride | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
446817,1 | QComboBox: hide the popup on keypress rather than ShortcutOverride | 6.4.2 | qt/qtbase | Status: ABANDONED | +2 | 0 |
447058,4 | QComboBox: Don't dereference potential nullptr, simplify | dev | qt/qtbase | Status: MERGED | +2 | 0 |
447507,2 | QComboBox: Don't dereference potential nullptr, simplify | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |