diff options
author | Tarja Sundqvist <[email protected]> | 2022-08-16 20:37:22 +0300 |
---|---|---|
committer | Tarja Sundqvist <[email protected]> | 2022-08-16 20:37:22 +0300 |
commit | f274d775774b78f6217c9770ae87045d969acbe1 (patch) | |
tree | d14162d5a1badabc71f6034bd4013b521d8f52e9 /src/quick/doc/snippets/qml/externaldrag.qml | |
parent | ae66ecf0f95c79d730190b92e641c0410d5d6896 (diff) | |
parent | eaf011c4ae440bbf7a02ceb7a33be5dfa5bcf907 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into tqtc/lts-5.15-opensourcev5.15.6-lts-lgpl
Change-Id: Ic3ca76460360cbab866a4e881c4848e6deeaf7d7
Diffstat (limited to 'src/quick/doc/snippets/qml/externaldrag.qml')
-rw-r--r-- | src/quick/doc/snippets/qml/externaldrag.qml | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/quick/doc/snippets/qml/externaldrag.qml b/src/quick/doc/snippets/qml/externaldrag.qml index 97a23293ca..5a88be2d4b 100644 --- a/src/quick/doc/snippets/qml/externaldrag.qml +++ b/src/quick/doc/snippets/qml/externaldrag.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ //![0] -import QtQuick 2.8 +import QtQuick 2.12 Item { width: 200; height: 200 @@ -59,7 +59,7 @@ Item { color: "green" radius: 5 - Drag.active: dragArea.drag.active + Drag.active: dragHandler.active Drag.dragType: Drag.Automatic Drag.supportedActions: Qt.CopyAction Drag.mimeData: { @@ -72,14 +72,14 @@ Item { text: "Drag me" } - MouseArea { - id: dragArea - anchors.fill: parent - - drag.target: parent - onPressed: parent.grabToImage(function(result) { - parent.Drag.imageSource = result.url - }) + DragHandler { + id: dragHandler + onActiveChanged: + if (active) { + parent.grabToImage(function(result) { + parent.Drag.imageSource = result.url; + }) + } } } } |