diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-17 22:28:38 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-17 22:34:24 +0100 |
commit | d294872b34667199455ca169d68be392942c3b00 (patch) | |
tree | 0f411d19e77e736792e5ff0125073baea2aaa3fa /src/pdf/quick/qml | |
parent | 24cd9f79bf7cf21e275b73ded63ee46bcc706db3 (diff) |
Enable mouse wheel scrolling in single-page PdfPageView
Change-Id: I20512187dcc872b2e0429968e9ad2a9899aee6c2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf/quick/qml')
-rw-r--r-- | src/pdf/quick/qml/PdfPageView.qml | 10 |
1 files changed, 10 insertions, 0 deletions
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 + } } |