Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15, 6.5.3
-
None
Description
If the platform theme defines ButtonPressKeys, then QGroupBoxes swallow those unconditionally. This is very noticable in dialogs: If any component within a group box has focus, pressing return no longer accepts the dialog.
This is a regression caused by https://codereview.qt-project.org/c/qt/qtbase/+/396253, earlier versions did not define any ButtonPressKeys.
The cause is this code in qgroupbox.cpp:
case QEvent::KeyPress: { QKeyEvent *k = static_cast<QKeyEvent*>(e); const auto buttonPressKeys = QGuiApplicationPrivate::platformTheme() ->themeHint(QPlatformTheme::ButtonPressKeys) .value<QList<Qt::Key>>(); if (!k->isAutoRepeat() && buttonPressKeys.contains(static_cast<Qt::Key>(k->key()))) { d->pressedControl = QStyle::SC_GroupBoxCheckBox; update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this)); return true; } break; }
It should probably check for d->checkable?