diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-06-03 16:49:03 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-06-04 20:55:32 +0200 |
commit | 24b7651599d3b4a53f781a9b27910a782506fed6 (patch) | |
tree | bf7b5566fc6567fc9f832cf0be9b301c46c53b49 /src/pdfquick | |
parent | 66aca3c846082c516bef3b35eb5332ebba24ce9e (diff) | |
download | qtwebengine-24b7651599d3b4a53f781a9b27910a782506fed6.tar.gz |
Fix issues in PdfLinkDelegate
- gesturePolicy must be set to take an exclusive grab, to avoid letting
events propagate to another TapHandler in TableView
- behavior was incorrect on the touchscreen
- fixed doc warnings about the undocumented link arguments
Change-Id: Ic438383b6b6d67936ce2b88b84ef131f41e0d2fb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/pdfquick')
-rw-r--r-- | src/pdfquick/PdfLinkDelegate.qml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pdfquick/PdfLinkDelegate.qml b/src/pdfquick/PdfLinkDelegate.qml index 83e6e9284..ee4afa0a3 100644 --- a/src/pdfquick/PdfLinkDelegate.qml +++ b/src/pdfquick/PdfLinkDelegate.qml @@ -67,14 +67,16 @@ Item { /*! \qmlsignal PdfLinkDelegate::tapped(link) - Emitted on mouse click or touch tap. + Emitted on mouse click or touch tap. The \a link argument is an + instance of QPdfLink with information about the hyperlink. */ signal tapped(var link) /*! \qmlsignal PdfLinkDelegate::contextMenuRequested(link) - Emitted on mouse right-click or touch long-press. + Emitted on mouse right-click or touch long-press. The \a link argument + is an instance of QPdfLink with information about the hyperlink. */ signal contextMenuRequested(var link) @@ -83,15 +85,18 @@ Item { cursorShape: Qt.PointingHandCursor } TapHandler { + gesturePolicy: TapHandler.ReleaseWithinBounds onTapped: root.tapped(link) } TapHandler { + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus acceptedButtons: Qt.RightButton + gesturePolicy: TapHandler.ReleaseWithinBounds onTapped: root.contextMenuRequested(link) } TapHandler { acceptedDevices: PointerDevice.TouchScreen - onTapped: root.contextMenuRequested(link) + onLongPressed: root.contextMenuRequested(link) } ToolTip { visible: linkHH.hovered |