Skip to content

Commit

Permalink
Remove assertion in QGroupBoxPrivate::shouldHandleKeyEvent()
Browse files Browse the repository at this point in the history
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 5d397a2.

Task-number: QTBUG-129095
Change-Id: I7b7167ac49b24844712c27b9fd4395a81687481f
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
ASpoerl committed Oct 31, 2024
1 parent d91bfbc commit 070d21a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/widgets/widgets/qgroupbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,8 @@ void QGroupBox::mouseReleaseEvent(QMouseEvent *event)
bool QGroupBoxPrivate::shouldHandleKeyEvent(const QKeyEvent *keyEvent) const
{
Q_Q(const QGroupBox);
Q_ASSERT(q->isEnabled());

if (!q->isCheckable() || keyEvent->isAutoRepeat())
if (!q->isEnabled() || !q->isCheckable() || keyEvent->isAutoRepeat())
return false;

const QList<Qt::Key> buttonPressKeys = QGuiApplicationPrivate::platformTheme()
Expand Down

0 comments on commit 070d21a

Please sign in to comment.