summaryrefslogtreecommitdiffstats
path: root/tests/manual/quick/pdf/withdoc.qml
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-02-21 11:38:27 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-02-21 11:40:49 +0100
commitd9349a299f66fb154ad24f410451872a7ca253fb (patch)
tree2e8258ef3679707a2a9245c85bc8490251b3e256 /tests/manual/quick/pdf/withdoc.qml
parent50bc8b124705c33c5e27f035b1eab756e14247ba (diff)
parentc0aa9d794378846e4cc0b6fe94f2765bc31cefdd (diff)
Merge remote-tracking branch 'origin/wip/qtpdf' into 5.15v5.15.0-beta1
The feature set is mostly in place (except for some known shortcomings) and we need the merge to build it on iOS. Task-number: QTBUG-69519 Change-Id: Ib1ac82a9a7e0830d98d1c4327a1b15d4d7f4d4c1
Diffstat (limited to 'tests/manual/quick/pdf/withdoc.qml')
-rw-r--r--tests/manual/quick/pdf/withdoc.qml47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/manual/quick/pdf/withdoc.qml b/tests/manual/quick/pdf/withdoc.qml
index 0fed5b16e..2d82a6abf 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,43 @@ Window {
onActivated: Qt.quit()
}
}
+
+ Shape {
+ anchors.fill: parent
+ opacity: 0.25
+ ShapePath {
+ fillColor: "cyan"
+ PathMultiline {
+ id: selectionBoundaries
+ paths: selection.geometry
+ }
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: doc
+ page: image.currentFrame
+ }
+ delegate: Rectangle {
+ color: "transparent"
+ border.color: "lightgrey"
+ x: rect.x
+ y: rect.y
+ width: rect.width
+ height: rect.height
+// HoverHandler { cursorShape: Qt.PointingHandCursor } // 5.15 onward (QTBUG-68073)
+ TapHandler {
+ onTapped: {
+ if (page >= 0)
+ image.currentFrame = page
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ }
}
}
}