diff options
author | Qt Forward Merge Bot <[email protected]> | 2019-09-12 19:49:23 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <[email protected]> | 2019-09-12 19:49:23 +0200 |
commit | 9a1e4ffa661648f4d5715874bbf2470bd5ec489b (patch) | |
tree | e362ff28d18fc73a3b6d1420da382c27f06d0081 /tests/auto/quick/qquicktext/tst_qquicktext.cpp | |
parent | c950ce0daf4b9fbfbcf6c00aa8ef4875297046f9 (diff) | |
parent | b0c9c5b8d9a78b8f9b6bbb32cf17733d4b582810 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 97107694bd..e62db81d27 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -164,6 +164,8 @@ private slots: void verticallyAlignedImageInTable(); + void transparentBackground(); + private: QStringList standard; QStringList richText; @@ -4429,6 +4431,26 @@ void tst_qquicktext::verticallyAlignedImageInTable() // Don't crash } +void tst_qquicktext::transparentBackground() +{ + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabToImage not functional on offscreen/minimimal platforms"); + + QScopedPointer<QQuickView> window(new QQuickView); + window->setSource(testFileUrl("transparentBackground.qml")); + QTRY_COMPARE(window->status(), QQuickView::Ready); + + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + QImage img = window->grabWindow(); + QCOMPARE(img.isNull(), false); + + QColor color = img.pixelColor(0, 0); + QCOMPARE(color.red(), 255); + QCOMPARE(color.blue(), 255); + QCOMPARE(color.green(), 255); +} QTEST_MAIN(tst_qquicktext) #include "tst_qquicktext.moc" |