summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@qt.io>2023-04-04 13:04:29 +0300
committerAxel Spoerl <axel.spoerl@qt.io>2023-04-20 20:42:04 +0000
commit54ea7b5a2a1364b8fcdef859229ca58afe8d87ad (patch)
treec7fe3c4052231b668067d977f4c570ca75cf9c37 /src
parent97c3782e2f5ecd3115aab1d0216b989b55f54f21 (diff)
downloadqtwebengine-54ea7b5a2a1364b8fcdef859229ca58afe8d87ad.tar.gz
QPdfNavigator: emit forward/backAvailableChanged when jumping pages
QPdfPageNavigator did not emit the page history signals when pages were jumped. This patch ensures correct signal emission in all cases. It adds a new auto test class for QPdfPageNavigator. Fixes: QTBUG-112614 Pick-to: 6.5 6.2 Change-Id: I67af5a4d22a8e76b9c12c72c168fa5b3b4390f2c Reviewed-by: Yigit Akcay <yigit.akcay@qt.io> Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/pdf/qpdfpagenavigator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp
index 253c1dff8..e077e2184 100644
--- a/src/pdf/qpdfpagenavigator.cpp
+++ b/src/pdf/qpdfpagenavigator.cpp
@@ -207,9 +207,9 @@ void QPdfPageNavigator::jump(QPdfLink destination)
emit currentLocationChanged(currentLocation());
if (d->changing)
return;
- if (!backAvailableWas)
+ if (backAvailableWas != backAvailable())
emit backAvailableChanged(backAvailable());
- if (forwardAvailableWas)
+ if (forwardAvailableWas != forwardAvailable())
emit forwardAvailableChanged(forwardAvailable());
emit jumped(currentLink());
qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << destination << "-> history" <<
@@ -263,9 +263,9 @@ void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom)
emit currentLocationChanged(currentLocation());
if (d->changing)
return;
- if (!backAvailableWas)
+ if (backAvailableWas != backAvailable())
emit backAvailableChanged(backAvailable());
- if (forwardAvailableWas)
+ if (forwardAvailableWas != forwardAvailable())
emit forwardAvailableChanged(forwardAvailable());
emit jumped(currentLink());
qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << "page" << page