summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-06-02 07:36:19 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-06-04 20:55:31 +0200
commitb22c25527711312830465b7d5bf56af0cc18d704 (patch)
tree3ff0f4265af0a46120c2c62e79fc84eaa90cc691
parent35697c1ded0577e88e774917a8ead31d7445465a (diff)
Give QPdfPageNavigator::jump() a default value for zoom
If the caller doesn't want to change it, it's easier to omit it rather than remembering that 0 is a special value. Change-Id: I851f678941e5144a9dea306fddba59fd15ed9939 Reviewed-by: Doris Verria <doris.verria@qt.io>
-rw-r--r--examples/pdf/multipage/viewer.qml2
-rw-r--r--src/pdf/qpdfpagenavigator.cpp4
-rw-r--r--src/pdf/qpdfpagenavigator.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index 3a12d9700..0e9855459 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -346,7 +346,7 @@ ApplicationWindow {
highlighted: ListView.isCurrentItem
onClicked: {
searchResultsList.currentIndex = resultDelegate.index
- view.goToLocation(resultDelegate.page, resultDelegate.location, 0)
+ view.goToLocation(resultDelegate.page, resultDelegate.location)
view.searchModel.currentResult = resultDelegate.indexOnPage
}
}
diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp
index 356f671e0..db40233e3 100644
--- a/src/pdf/qpdfpagenavigator.cpp
+++ b/src/pdf/qpdfpagenavigator.cpp
@@ -208,8 +208,8 @@ void QPdfPageNavigator::clear()
to the history of visited locations.
The \a zoom argument represents magnification (where \c 1 is the default
- scale, 1 logical pixel = 1 point). If \a zoom is given as \c 0, currentZoom
- keeps its existing value, and currentZoomChanged is not emitted.
+ scale, 1 logical pixel = 1 point). If \a zoom is not given or is \c 0,
+ currentZoom keeps its existing value, and currentZoomChanged is not emitted.
The \a location should be the same as QPdfLink::location() if the user is
following a link; and since that is specified as the upper-left corner of
diff --git a/src/pdf/qpdfpagenavigator.h b/src/pdf/qpdfpagenavigator.h
index cab6e612c..2e92b2dc1 100644
--- a/src/pdf/qpdfpagenavigator.h
+++ b/src/pdf/qpdfpagenavigator.h
@@ -71,7 +71,7 @@ public:
public Q_SLOTS:
void clear();
- void jump(int page, const QPointF &location, qreal zoom);
+ void jump(int page, const QPointF &location, qreal zoom = 0);
void update(int page, const QPointF &location, qreal zoom);
void forward();
void back();