diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-12 19:49:23 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-12 19:49:23 +0200 |
commit | 9a1e4ffa661648f4d5715874bbf2470bd5ec489b (patch) | |
tree | e362ff28d18fc73a3b6d1420da382c27f06d0081 /tests | |
parent | c950ce0daf4b9fbfbcf6c00aa8ef4875297046f9 (diff) | |
parent | b0c9c5b8d9a78b8f9b6bbb32cf17733d4b582810 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
Diffstat (limited to 'tests')
m--------- | tests/auto/qml/ecmascripttests/test262 | 0 | ||||
-rw-r--r-- | tests/auto/quick/qquicktext/data/transparentBackground.qml | 16 | ||||
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 22 |
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qml/ecmascripttests/test262 b/tests/auto/qml/ecmascripttests/test262 -Subproject 6b0c42c63c2492bd0a7a96d3179d122b5f71793 +Subproject 3c69133cc419840c1be34638039cd8c48a7ef58 diff --git a/tests/auto/quick/qquicktext/data/transparentBackground.qml b/tests/auto/quick/qquicktext/data/transparentBackground.qml new file mode 100644 index 0000000000..a10a1779bb --- /dev/null +++ b/tests/auto/quick/qquicktext/data/transparentBackground.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 + +Rectangle { + width: 200 + height: 200 + color: "white" + Text { + objectName: "text" + textFormat: Text.RichText + anchors.fill: parent + color: "black" + text: "<h1 style=\"background-color:rgba(255,255,255,0.00)\">foo</h1>" + verticalAlignment: Text.AlignTop + horizontalAlignment: Text.AlignLeft + } +} 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" |