diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-06-12 10:08:21 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-16 03:30:13 +0000 |
commit | 87b33b452e8bf5aa77eee40e225e987eaac07892 (patch) | |
tree | 7708e3b6ea2909f42e89a5cd8ecc44f7f7e26846 | |
parent | ce6f8eaef63b1fad723bcdc7d727872efddfa424 (diff) |
Add active/inactive transition to color group test
Amends 3675f2b235f32e05cf6d754e81e0e8f8ddd59752 by testing that window
(de)activation changes the current color group.
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>
(cherry picked from commit 23b2767f66b824341085cd1e7d5bb2b36c34592d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 10 |
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) |