aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem2
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-06-12 10:08:21 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-06-16 04:09:59 +0200
commit23b2767f66b824341085cd1e7d5bb2b36c34592d (patch)
tree51ae24a3c19f81dbd178a69adf21f9e692121a22 /tests/auto/quick/qquickitem2
parent2d67d69878ce7b76157ac87c9a6a670b5f0f75f9 (diff)
Add active/inactive transition to color group test
Amends 3675f2b235f32e05cf6d754e81e0e8f8ddd59752 by testing that window (de)activation changes the current color group. Pick-to: 6.2 Task-number: QTBUG-93752 Change-Id: I031956c68c806b169ad02f2877581571aa3ff3f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickitem2')
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 622a278411..843b916eb1 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -3758,6 +3758,16 @@ void tst_QQuickItem::colorGroup()
background->setEnabled(true);
QCOMPARE(palette->currentColorGroup(), QPalette::Inactive);
QCOMPARE(foreground->property("color").value<QColor>(), palette->inactive()->base());
+
+ view.requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+ QCOMPARE(palette->currentColorGroup(), QPalette::Active);
+ QCOMPARE(foreground->property("color").value<QColor>(), palette->active()->base());
+
+ activationThief.requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(&activationThief));
+ QCOMPARE(palette->currentColorGroup(), QPalette::Inactive);
+ QCOMPARE(foreground->property("color").value<QColor>(), palette->inactive()->base());
}
QTEST_MAIN(tst_QQuickItem)