diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-19 15:46:02 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-19 18:20:32 +0100 |
commit | 57af89d1fcbc81e9d17a02be3f54ca239afe6697 (patch) | |
tree | 1ced3d9d5c917ab458e9d05a86b73fdaa71d7cc5 /src/pdf/quick/qml | |
parent | 34f52195b99a03dfdacc6b1eccb236d553b93ac0 (diff) |
Fix PdfLinkModel's location y coordinate; add PdfMultiPageView tooltip
As usual, coordinates are in the first quadrant, and we need to
convert to 4th quadrant to get a y value that can be used to adjust
contentY of a ListView or TableView.
The tooltip when hovering over links provides a way to verify that
the link really jumps where it's intended to.
Change-Id: I9107639f15496a987c0fa7c3c2e2583c3839cc6b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf/quick/qml')
-rw-r--r-- | src/pdf/quick/qml/PdfMultiPageView.qml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pdf/quick/qml/PdfMultiPageView.qml b/src/pdf/quick/qml/PdfMultiPageView.qml index b64f44576..b4bc61c64 100644 --- a/src/pdf/quick/qml/PdfMultiPageView.qml +++ b/src/pdf/quick/qml/PdfMultiPageView.qml @@ -242,8 +242,10 @@ Item { width: rect.width * paper.pageScale height: rect.height * paper.pageScale MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15 + id: linkMA anchors.fill: parent cursorShape: Qt.PointingHandCursor + hoverEnabled: true onClicked: { if (page >= 0) root.goToLocation(page, location, zoom) @@ -251,6 +253,14 @@ Item { Qt.openUrlExternally(url) } } + ToolTip { + visible: linkMA.containsMouse + delay: 1000 + text: page >= 0 ? + ("page " + (page + 1) + + " location " + location.x.toFixed(1) + ", " + location.y.toFixed(1) + + " zoom " + zoom) : url + } } } } |