diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf/multipage/viewer.qml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml index 56e7188f6..fcf326869 100644 --- a/examples/pdf/multipage/viewer.qml +++ b/examples/pdf/multipage/viewer.qml @@ -194,6 +194,19 @@ ApplicationWindow { onCurrentPageChanged: currentPageSB.value = view.currentPage + 1 } + DropArea { + anchors.fill: parent + keys: ["text/uri-list"] + onEntered: (drag) => { + drag.accepted = (drag.proposedAction === Qt.MoveAction || drag.proposedAction === Qt.CopyAction) && + drag.hasUrls && drag.urls[0].endsWith("pdf") + } + onDropped: (drop) => { + doc.source = drop.urls[0] + drop.acceptProposedAction() + } + } + Drawer { id: sidebar edge: Qt.LeftEdge |