diff options
author | Oleg Yadrov <oleg.yadrov@qt.io> | 2016-12-20 16:45:20 -0800 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-01-02 07:01:15 +0000 |
commit | f70066e95e7e23562155686cb7d7874b2d5da5a1 (patch) | |
tree | 0e0741e13455291f4a433077ba6b0d7b0b56c0fb /tests/auto/quick/qquickwindow/data | |
parent | bb123fa3a4b06dabb2a63304ee3d24f94d74c1f2 (diff) |
Make it possible to call grabToImage() on Window.contentItem
Window.contentItem was not associated with any QQmlContext and
QQmlEngine. A valid pointer to QQmlEngine is needed for callback
function execution.
Task-number: QTBUG-57175
Change-Id: Iab7730bfc8860521ff2e8c1631a11d0e1fe0cf94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwindow/data')
-rw-r--r-- | tests/auto/quick/qquickwindow/data/grabContentItemToImage.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/data/grabContentItemToImage.qml b/tests/auto/quick/qquickwindow/data/grabContentItemToImage.qml new file mode 100644 index 0000000000..9086e0cc84 --- /dev/null +++ b/tests/auto/quick/qquickwindow/data/grabContentItemToImage.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QtQuick.Window 2.2 as Window + +Window.Window { + visible: true + width: 100 + height: 100 + property int success: 0 + + function grabContentItemToImage() { + contentItem.grabToImage(function (image) { + success = 1 + }) + } +} |