PdfPageNavigator QML Type

PDF 文档中访问目的地的历史记录。更多

Import Statement: import QtQuick.Pdf

属性

信号

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

方法

  • void back()
  • void forward()
  • void jump(int page, point location, qreal zoom, bool emitJumped)
  • void update(int page, point location, qreal zoom)

详细说明

PdfPageNavigator 能记住用户在 PDF 文档中访问过的目的地,并提供向前和向后遍历的功能。

属性文档

backAvailable : bool [read-only]

如果历史记录中存在后退目的地,则保持true


currentLocation : point

该属性保存当前浏览页面的位置。


currentPage : int

该属性显示当前浏览的页面。如果没有当前页面,则保存-1


currentZoom : real

该属性显示正在查看的页面的放大比例。


forwardAvailable : bool [read-only]

如果历史记录中有转发目的地,则保存true


信号文档

jumped(int page, point location, qreal zoom)

当突然跳转到指定的page 索引、页面上的locationzoom 级别时,会发出该信号;但每次只滚动一页文档时不会发出该信号。也就是说,forward()、back() 和jump() 始终会发出该信号;而update() 则不会。

注: 相应的处理程序是onJumped


方法文档

void back()

弹出堆栈,将currentPagecurrentLocationcurrentZoom 属性更新为最近查看的目标,然后发出jumped() 信号。


void forward()

返回调用back() 之前正在查看的页面、位置和缩放级别,然后发出jumped() 信号。

如果在上次调用back() 后推送了新的目的地,forward() 函数不会执行任何操作,因为时间轴上的分支会导致 "未来 "丢失。


void jump(int page, point location, qreal zoom, bool emitJumped)

将给定的目的地(由pagelocationzoom 组成)添加到历史访问位置中。如果emitJumpedfalse ,则不会发出jumped() 信号。

如果forwardAvailabletrue ,则调用此函数代表时间线的一个分支,会导致 "未来 "丢失,因此forwardAvailable 将变为false


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

修改当前目的地,由pagelocationzoom 组成。

当用户在文档中手动移动时,可以定期调用该功能,这样在调用back() 后,forward() 将跳回最近查看的目标地址,而不是jump() 最后指定的目标地址。

如果实际更改了相应的属性,则会发出currentZoomChangedcurrentPageChangedcurrentLocationChanged 信号。jumped 信号不会发出,因为该操作代表的是平滑移动,而不是导航跳转。


© 2025 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.