From 1f785521ab6982e7395af223e28137d65f8ead12 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge <shawn.rutledge@qt.io> Date: Tue, 4 Feb 2020 16:42:27 +0100 Subject: [PATCH] Temporarily use MouseArea for links in Pdf(Multi)PageView HoverHandler.cursorShape is new API in 5.15, so we have to use MouseArea for 5.14. This patch can be reverted as soon as 5.14 is no longer supported. Change-Id: I1c830215729038095ec33ece36a1a83108cbd835 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> --- src/pdf/quick/qml/PdfMultiPageView.qml | 17 +++++++++-------- src/pdf/quick/qml/PdfPageView.qml | 13 +++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/pdf/quick/qml/PdfMultiPageView.qml b/src/pdf/quick/qml/PdfMultiPageView.qml index 36b194812..f64238eec 100644 --- a/src/pdf/quick/qml/PdfMultiPageView.qml +++ b/src/pdf/quick/qml/PdfMultiPageView.qml @@ -47,12 +47,12 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.Layouts 1.14 import QtQuick.Pdf 5.15 -import QtQuick.Shapes 1.15 -import QtQuick.Window 2.15 +import QtQuick.Shapes 1.14 +import QtQuick.Window 2.14 Item { // public API @@ -159,9 +159,10 @@ Item { y: rect.y * paper.__pageScale width: rect.width * paper.__pageScale height: rect.height * paper.__pageScale - HoverHandler { cursorShape: Qt.PointingHandCursor } // 5.15 only (QTBUG-68073) - TapHandler { - onTapped: { + MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15 + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { if (page >= 0) listView.currentIndex = page else diff --git a/src/pdf/quick/qml/PdfPageView.qml b/src/pdf/quick/qml/PdfPageView.qml index 041054e59..cf287ecf7 100644 --- a/src/pdf/quick/qml/PdfPageView.qml +++ b/src/pdf/quick/qml/PdfPageView.qml @@ -33,10 +33,10 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 +import QtQuick 2.14 +import QtQuick.Controls 2.14 import QtQuick.Pdf 5.15 -import QtQuick.Shapes 1.15 +import QtQuick.Shapes 1.14 Rectangle { id: paper @@ -198,9 +198,10 @@ Rectangle { y: rect.y * paper.__pageScale width: rect.width * paper.__pageScale height: rect.height * paper.__pageScale - HoverHandler { cursorShape: Qt.PointingHandCursor } // 5.15 onward (QTBUG-68073) - TapHandler { - onTapped: { + MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15 + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { if (page >= 0) navigationStack.currentPage = page else -- GitLab