From ccbd6fbdbe071f42e1c060ca579786758701f358 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 15 Jan 2020 09:44:10 +0100 Subject: Add PdfLinkModel Internal links and web links populate the QALM, which can then be used to drive a Repeater to position highlight rectangles with TapHandlers, which will handle a click by jumping to the link destination. Fixes: QTBUG-77511 Change-Id: I3b5b96d6e82bfd578f31f631f24279173036a080 Reviewed-by: Leena Miettinen Reviewed-by: Michal Klocek --- tests/manual/quick/pdf/withdoc.qml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests') diff --git a/tests/manual/quick/pdf/withdoc.qml b/tests/manual/quick/pdf/withdoc.qml index fe3297ee8..2d82a6abf 100644 --- a/tests/manual/quick/pdf/withdoc.qml +++ b/tests/manual/quick/pdf/withdoc.qml @@ -171,6 +171,31 @@ Window { } } } + + 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) + } + } + } + } } } } -- cgit v1.2.3