diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-03 11:57:06 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-06 11:27:22 +0000 |
commit | 2bb63f9e52b4cb025061734c171252564d69c6a9 (patch) | |
tree | 9b35adf07006ccea82cd20ae0e0d870126a9276d /tests/manual | |
parent | d45718b33cb97218ff042e95ee7774fd8c8d63a3 (diff) |
D3D12: Implement grabWindow
Change-Id: Icb8151f26bad68795eb2e1f920297267c880b40b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/nodetypes/main.qml | 3 | ||||
-rw-r--r-- | tests/manual/nodetypes/nodetypes.cpp | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/manual/nodetypes/main.qml b/tests/manual/nodetypes/main.qml index 87d42da3bb..2ec2d37f14 100644 --- a/tests/manual/nodetypes/main.qml +++ b/tests/manual/nodetypes/main.qml @@ -74,5 +74,8 @@ Item { if (event.key === Qt.Key_P) loader.source = "qrc:/Painter.qml"; + + if (event.key === Qt.Key_G) + helper.testGrab() } } diff --git a/tests/manual/nodetypes/nodetypes.cpp b/tests/manual/nodetypes/nodetypes.cpp index ac54e069ed..8dc282894f 100644 --- a/tests/manual/nodetypes/nodetypes.cpp +++ b/tests/manual/nodetypes/nodetypes.cpp @@ -151,9 +151,19 @@ class Helper : public QObject Q_OBJECT public: + Helper(QQuickWindow *w) : m_window(w) { } + Q_INVOKABLE void sleep(int ms) { QThread::msleep(ms); } + + Q_INVOKABLE void testGrab() { + QImage img = m_window->grabWindow(); + qDebug() << "Saving image to grab_result.png" << img; + img.save("grab_result.png"); + } + + QQuickWindow *m_window; }; int main(int argc, char **argv) @@ -171,10 +181,11 @@ int main(int argc, char **argv) qDebug(" [L] - Layers"); qDebug(" [E] - Effects"); qDebug(" [P] - QQuickPaintedItem"); + qDebug(" [G] - Grab current window"); qDebug("\nPress S to stop the currently running test\n"); - Helper helper; QQuickView view; + Helper helper(&view); if (app.arguments().contains(QLatin1String("--multisample"))) { qDebug("Requesting sample count 4"); QSurfaceFormat fmt; |