PDF multipage view: track specific link and navigation destinations
Unfortunately it's getting harder to do things declaratively, because we
have to avoid circular bindings, and because of needing to use imperative
APIs. The current-page spinbox provides onValueModified() to detect when
the user modifies it, distinct from the simple fact that the value changed.
We shouldn't make bindings to set ListView.currentIndex anyway, because
that results in slow animation (and loading pages in all delegates along
the way) rather than quick jumping to the correct page. Instead we need
to use ListView.positionViewAtIndex(), another imperative API, to get
quick jumps without having to calculate and set contentY in some other way.
Now we move toward the NavigationStack providing storage for the current
destination at all times. Changes there will trigger programmatically
moving the ListView.
When the user scrolls manually, that generates a "destination" in the
navigation stack, such that the back button can jump back to the
previous location, and then the forward button can return to the
destination where manual scrolling ended up.
Fixes: QTBUG-77510
Change-Id: I47544210d2e0f9aa790f3d2594839678374e463d
Reviewed-by:
Shawn Rutledge <shawn.rutledge@qt.io>
Showing
Please register or sign in to comment