From 070d21aa29890c65c88cfb1c9f013c619da2af10 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Thu, 31 Oct 2024 06:23:43 +0100 Subject: [PATCH] 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 --- src/widgets/widgets/qgroupbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index d5b471ff65a..991dc028c83 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -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 buttonPressKeys = QGuiApplicationPrivate::platformTheme()