Remove assertion in QGroupBoxPrivate::shouldHandleKeyEvent()

A disabled QGroupBox doesn't receive key events in any screnario
implemented within Qt. It can, however, receive such an event directly
in an external implementation.

Remove the assertion and return false instead.

This amends 5d397a262f2af66169c861a0b507cbb5fd27a008.

Task-number: QTBUG-129095
Change-Id: I7b7167ac49b24844712c27b9fd4395a81687481f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Axel Spoerl 2024-10-31 06:23:43 +01:00
parent d91bfbcf65
commit 070d21aa29

View File

@ -727,9 +727,8 @@ void QGroupBox::mouseReleaseEvent(QMouseEvent *event)
bool QGroupBoxPrivate::shouldHandleKeyEvent(const QKeyEvent *keyEvent) const bool QGroupBoxPrivate::shouldHandleKeyEvent(const QKeyEvent *keyEvent) const
{ {
Q_Q(const QGroupBox); Q_Q(const QGroupBox);
Q_ASSERT(q->isEnabled());
if (!q->isCheckable() || keyEvent->isAutoRepeat()) if (!q->isEnabled() || !q->isCheckable() || keyEvent->isAutoRepeat())
return false; return false;
const QList<Qt::Key> buttonPressKeys = QGuiApplicationPrivate::platformTheme() const QList<Qt::Key> buttonPressKeys = QGuiApplicationPrivate::platformTheme()