From d294872b34667199455ca169d68be392942c3b00 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 17 Feb 2020 22:28:38 +0100 Subject: Enable mouse wheel scrolling in single-page PdfPageView Change-Id: I20512187dcc872b2e0429968e9ad2a9899aee6c2 Reviewed-by: Shawn Rutledge --- src/pdf/quick/qml/PdfPageView.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/pdf/quick/qml') diff --git a/src/pdf/quick/qml/PdfPageView.qml b/src/pdf/quick/qml/PdfPageView.qml index ec3cd78e0..dfd00a1a8 100644 --- a/src/pdf/quick/qml/PdfPageView.qml +++ b/src/pdf/quick/qml/PdfPageView.qml @@ -37,6 +37,7 @@ import QtQuick 2.14 import QtQuick.Controls 2.14 import QtQuick.Pdf 5.15 import QtQuick.Shapes 1.14 +import Qt.labs.animation 1.0 Rectangle { // public API @@ -260,4 +261,13 @@ Rectangle { id: tapHandler acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus } + // prevent it from being scrolled out of view + BoundaryRule on x { + minimum: 100 - root.width + maximum: root.parent.width - 100 + } + BoundaryRule on y { + minimum: 100 - root.height + maximum: root.parent.height - 100 + } } -- cgit v1.2.3