diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/quick/pdf/withdoc.qml | 47 |
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) + } + } + } + } } } } |