From 41e8f7046949b7418c6780e342ddc0c2d4bbd026 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 7 Apr 2020 17:16:46 +0000 Subject: 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 --- examples/pdf/multipage/viewer.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/pdf') 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 { -- cgit v1.2.3