diff options
Diffstat (limited to 'src/quick/doc/snippets/qml/externaldrag.qml')
-rw-r--r-- | src/quick/doc/snippets/qml/externaldrag.qml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quick/doc/snippets/qml/externaldrag.qml b/src/quick/doc/snippets/qml/externaldrag.qml index 3c504004de..723701a7a5 100644 --- a/src/quick/doc/snippets/qml/externaldrag.qml +++ b/src/quick/doc/snippets/qml/externaldrag.qml @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.12 +import QtQuick Item { width: 200; height: 200 @@ -12,7 +12,6 @@ Item { color: "green" radius: 5 - Drag.active: dragHandler.active Drag.dragType: Drag.Automatic Drag.supportedActions: Qt.CopyAction Drag.mimeData: { @@ -30,8 +29,11 @@ Item { onActiveChanged: if (active) { parent.grabToImage(function(result) { - parent.Drag.imageSource = result.url; + parent.Drag.imageSource = result.url + parent.Drag.active = true }) + } else { + parent.Drag.active = false } } } |