From 4a7f21da6e7d1f513fc60dccfff6d6b81a116f21 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sun, 24 Mar 2019 18:53:52 +0100 Subject: Add QQuickPathMultiLine And show our users even more love. This path element allows to specify a list of polylines as a single list of lists of points. [ChangeLog][QtQuick][Path] Added QQuickPathMultiLine. Change-Id: Idf1d1dcd928bb19b9ad995322f86822448811537 Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquickshape/tst_qquickshape.cpp | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/auto/quick/qquickshape/tst_qquickshape.cpp') diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp index 174ada65a5..b3b8d2d148 100644 --- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp +++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp @@ -59,6 +59,7 @@ private slots: void radialGrad(); void conicalGrad(); void renderPolyline(); + void renderMultiline(); }; tst_QQuickShape::tst_QQuickShape() @@ -343,6 +344,35 @@ void tst_QQuickShape::renderPolyline() QVERIFY2(res, qPrintable(errorMessage)); } +void tst_QQuickShape::renderMultiline() +{ + QScopedPointer window(createView()); + + window->setSource(testFileUrl("pathitem8.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + + QImage img = window->grabWindow(); + QVERIFY(!img.isNull()); + + QImage refImg(testFileUrl("pathitem8.png").toLocalFile()); + QVERIFY(!refImg.isNull()); + + QString errorMessage; + const QImage actualImg = img.convertToFormat(refImg.format()); + const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage); + if (!res) { // For visual inspection purposes. + QTest::qWait(5000); + const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + actualImg.save(tempLocation + QLatin1String("/pathitem8.png")); + } + QVERIFY2(res, qPrintable(errorMessage)); +} + QTEST_MAIN(tst_QQuickShape) #include "tst_qquickshape.moc" -- cgit v1.2.3