summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2024-04-24 19:24:40 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2024-04-26 17:26:07 +0000
commit913442a75a269048bea7968aa2708888e10611c4 (patch)
tree7e701125ddc52dcf11606318eba89bc61df9e43d /tests/auto/widgets/kernel
parent48a2ee1e9dc82bffdd533525fb4304a49ebf68ef (diff)
Widgets focus abstraction: Skip isFocusChainConsistent w/o logging cat
QWidgetPrivate::isFocusChainConsistent() iterates over QApplication::allWidgets() to identify and log inconsistencies. In applications with many widgets, this has a major performance impact. Disable the check and return true, unless the logging category qt.widgets.focus is enabled. Adapt tst_QWidget::focusAbstraction() to enable the logging category. This amends 58d5d4b7c2faaeaa2c2ccdabb3da6d37f9db880a. Fixes: QTBUG-124666 Change-Id: Ia487b381ab45b052638b189bf56acaf4353b1a37 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 0dde95cada..9b66002a2f 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -2017,6 +2017,7 @@ static QList<QWidget *> getFocusChain(QWidget *start, bool bForward)
void tst_QWidget::focusAbstraction()
{
+ QLoggingCategory::setFilterRules("qt.widgets.focus=true");
QWidget *widget1 = new QWidget;
widget1->setObjectName("Widget 1");
QWidget *widget2 = new QWidget;