diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-04-07 17:16:46 +0000 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-04-16 12:49:01 +0000 |
commit | 41e8f7046949b7418c6780e342ddc0c2d4bbd026 (patch) | |
tree | 64f6323b1778c056ce5445b25cb9c57609d36a1e /examples | |
parent | 707b66cbf7da4e31bfd897e5c4bc6889bc09ef9a (diff) |
Fix PgUp/PgDown navigation in the PDF multi-page example
SpinBox.valueModified is emitted only when the user interactively
modifies the value; so SpinBox.value++ doesn't trigger view.goToPage().
Therefore we should call it explicitly when handling those key shortcuts.
Change-Id: I9648d1d143812d34d77218fd9ed7559415d13f63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf/multipage/viewer.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml index bcb898a80..f66c8d381 100644 --- a/examples/pdf/multipage/viewer.qml +++ b/examples/pdf/multipage/viewer.qml @@ -143,11 +143,11 @@ ApplicationWindow { onValueModified: view.goToPage(value - 1) Shortcut { sequence: StandardKey.MoveToPreviousPage - onActivated: currentPageSB.value-- + onActivated: view.goToPage(currentPageSB.value - 2) } Shortcut { sequence: StandardKey.MoveToNextPage - onActivated: currentPageSB.value++ + onActivated: view.goToPage(currentPageSB.value) } } ToolButton { |