summaryrefslogtreecommitdiffstats
path: root/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp')
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index 60495596d1..ee49c9c7ad 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -55,6 +55,7 @@ private slots:
void engine();
void readback();
void renderingSignals();
+ void grab();
void grabBeforeShow();
void reparentToNewWindow();
void nullEngine();
@@ -298,6 +299,15 @@ void tst_qquickwidget::renderingSignals()
QTRY_VERIFY(afterRenderingSpy.size() > 0);
}
+void tst_qquickwidget::grab()
+{
+ QQuickWidget view;
+ view.setSource(testFileUrl("rectangle.qml"));
+ QPixmap pixmap = view.grab();
+ QRgb pixel = pixmap.toImage().pixel(5, 5);
+ QCOMPARE(pixel, qRgb(255, 0, 0));
+}
+
// QTBUG-49929, verify that Qt Designer grabbing the contents before drag
// does not crash due to missing GL contexts or similar.
void tst_qquickwidget::grabBeforeShow()