PdfNavigationStack QML Type

History of the destinations visited within a PDF Document. More...

Import Statement: import QtQuick.Pdf 5.15
Since: Qt 5.15

Properties

Signals

  • jumped(int page, point location, qreal zoom)

Methods

  • void back()
  • void forward()
  • void push(int page, point location, qreal zoom)
  • void update(int page, point location, qreal zoom)

Detailed Description

PdfNavigationStack remembers which destinations the user has visited in a PDF document, and provides the ability to traverse backward and forward.

Property Documentation

currentLocation : point

This property holds the current location on the page that is being viewed.


currentPage : int

This property holds the current page that is being viewed. If there is no current page, it holds -1.


currentZoom : real

This property holds the magnification scale on the page that is being viewed.


Signal Documentation

jumped(int page, point location, qreal zoom)

This signal is emitted when forward(), back() or push() is called, but not when update() is called.

Note: The corresponding handler is onJumped.


Method Documentation

void back()

Pops the stack, updates the currentPage, currentLocation and currentZoom properties to the most-recently-viewed destination, and then emits the jumped() signal.


void forward()

Goes back to the page, location and zoom level that was being viewed before back() was called, and then emits the jumped() signal.

If a new destination was pushed since the last time back() was called, the forward() function does nothing, because there is a branch in the timeline which causes the "future" to be lost.


void push(int page, point location, qreal zoom)

Adds the given destination, consisting of page, location and zoom, to the history of visited locations. If emitJumped is false, the jumped() signal will not be emitted.

If forwardAvailable is true, calling this function represents a branch in the timeline which causes the "future" to be lost, and therefore forwardAvailable will change to false.


void update(int page, point location, qreal zoom)

Modifies the current destination, consisting of page, location and zoom.

This can be called periodically while the user is manually moving around the document, so that after back() is called, forward() will jump back to the most-recently-viewed destination rather than the destination that was last specified by push().

The currentZoomChanged, currentPageChanged and currentLocationChanged signals will be emitted if the respective properties are actually changed. The jumped signal is not emitted, because this operation represents smooth movement rather than a navigational jump.


© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.