From 87b33b452e8bf5aa77eee40e225e987eaac07892 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sat, 12 Jun 2021 10:08:21 +0200 Subject: Add active/inactive transition to color group test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Mitch Curtis (cherry picked from commit 23b2767f66b824341085cd1e7d5bb2b36c34592d) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(), palette->inactive()->base()); + + view.requestActivate(); + QVERIFY(QTest::qWaitForWindowActive(&view)); + QCOMPARE(palette->currentColorGroup(), QPalette::Active); + QCOMPARE(foreground->property("color").value(), palette->active()->base()); + + activationThief.requestActivate(); + QVERIFY(QTest::qWaitForWindowActive(&activationThief)); + QCOMPARE(palette->currentColorGroup(), QPalette::Inactive); + QCOMPARE(foreground->property("color").value(), palette->inactive()->base()); } QTEST_MAIN(tst_QQuickItem) -- cgit v1.2.3