aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-09-20 12:53:31 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-09-22 08:04:05 +0000
commite1a303dd01f2e7faa3ec54386ecbbfe113996790 (patch)
treeb38bcd50d0aacc39c69956244e744a8368c3f6ab /examples/quick/quickwidgets/quickwidget/rotatingsquare.qml
parent7af1c2dc0e160652a9583cf1798720cd0f3d72f8 (diff)
Enhance quickwidget example with all grabbing cases
Add a demo of QQuickItem::grabToImage(), in addition to grabFramebuffer() and render(). This way all possible approaches are demonstrated and tested. Task-number: QTBUG-55879 Change-Id: I13c427730c416f0d87f83092627e2cb46aba2cc4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/quickwidgets/quickwidget/rotatingsquare.qml')
-rw-r--r--examples/quick/quickwidgets/quickwidget/rotatingsquare.qml6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml
index 0c25eddf88..03b1114d20 100644
--- a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml
+++ b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml
@@ -57,4 +57,10 @@ Rectangle {
anchors.centerIn: parent
text: "Qt Quick running in a widget"
}
+
+ function performLayerBasedGrab(fn) {
+ root.grabToImage(function(result) {
+ result.saveToFile(fn);
+ });
+ }
}