summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-01-20 18:29:05 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-01-30 16:26:27 +0100
commitbc1d6ddeb5076f68e0a758725a20c3f2a6d081f0 (patch)
treec730d9ffbe79b262fbe6962fa2daa3f14adf0fc5 /tests
parent4f5f0705bc161ff95899fdb2c5fcdb4581bf15bb (diff)
Add QPdfSelection and QQuickPdfSelection
So now you can select text by mouse-drag and copy it to the clipboard. Task-number: QTBUG-77509 Change-Id: I689ee4158974de8bc541c319a5a5cc2f8f3c2ae6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/quick/pdf/withdoc.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/manual/quick/pdf/withdoc.qml b/tests/manual/quick/pdf/withdoc.qml
index 0fed5b16e..fe3297ee8 100644
--- a/tests/manual/quick/pdf/withdoc.qml
+++ b/tests/manual/quick/pdf/withdoc.qml
@@ -51,6 +51,7 @@ import QtQuick 2.14
import QtQuick.Controls 2.14
import Qt.labs.platform 1.1 as Platform
import QtQuick.Pdf 5.15
+import QtQuick.Shapes 1.14
import QtQuick.Window 2.14
Window {
@@ -72,6 +73,15 @@ Window {
onAccepted: doc.source = file
}
+ PdfSelection {
+ id: selection
+ document: doc
+ page: image.currentFrame
+ fromPoint: dragHandler.centroid.pressPosition
+ toPoint: dragHandler.centroid.position
+ hold: !dragHandler.active
+ }
+
Column {
id: column
anchors.fill: parent
@@ -149,6 +159,18 @@ Window {
onActivated: Qt.quit()
}
}
+
+ Shape {
+ anchors.fill: parent
+ opacity: 0.25
+ ShapePath {
+ fillColor: "cyan"
+ PathMultiline {
+ id: selectionBoundaries
+ paths: selection.geometry
+ }
+ }
+ }
}
}
}