QPdfLinkModel类
QPdfLinkModel类持有指定页面中每个链接的几何形状和目标。 更多...
| 头文件 | #include <QPdfLinkModel> | 
| 自 | Qt 6.6 | 
| 继承 | QAbstractListModel | 
公共类型
| enum class | Role { Link, Rectangle, Url, Page, Location, Zoom } | 
属性
公共函数
| QPdfLinkModel(QObject *parent = nullptr) | |
| virtual | ~QPdfLinkModel() override | 
| QPdfDocument * | document() const | 
| QPdfLink | linkAt(QPointF point) const | 
| int | page() const | 
重实现的公共函数
| virtual QVariant | data(const QModelIndex &index, int role) const override | 
| virtual int | rowCount(const QModelIndex &parent) const override | 
公共槽
| void | setDocument(QPdfDocument *document) | 
| void | setPage(int page) | 
信号
| void | documentChanged() | 
| void | pageChanged(int page) | 
成员类型文档
enum class QPdfLinkModel::Role
| 常量 | 值 | 描述 | 
|---|---|---|
| QPdfLinkModel::Role::Link | Qt::UserRole | 一个QPdfLink对象。 | 
| QPdfLinkModel::Role::Rectangle | 257 | 链接周围的边界矩形。 | 
| QPdfLinkModel::Role::Url | 258 | 如果是网页链接,则为此链接的URL;否则为空URL。 | 
| QPdfLinkModel::Role::Page | 259 | 如果是内部链接,则链接应跳转到的页码;否则 -1。 | 
| QPdfLinkModel::Role::Location | 260 | 如果是内部链接,则链接应跳转到页面上的位置。 | 
| QPdfLinkModel::Role::Zoom | 261 | 如果是内部链接,则目标页面的建议缩放级别。 | 
属性文档
document : QPdfDocument*
此属性持有用于加载链接的文档。
访问函数
| QPdfDocument * | document() const | 
| void | setDocument(QPdfDocument *document) | 
通知信号
| void | documentChanged() | 
page : int
此属性持有用于加载链接的页面。
访问函数
| int | page() const | 
| void | setPage(int page) | 
通知信号
| void | pageChanged(int page) | 
成员函数文档
[显式] QPdfLinkModel::QPdfLinkModel(QObject *parent = nullptr)
创建一个新的具有父对象 parent 的链接模型。
[重载虚函数 noexcept] QPdfLinkModel::~QPdfLinkModel()
销毁模型。
[重载虚函数] QVariant QPdfLinkModel::data(const QModelIndex &index, int role) const
重写: QAbstractItemModel::data(const QModelIndex &index, int role) const.
QPdfLink QPdfLinkModel::linkAt(QPointF point) const
如果找到指定点位(以点为单位,1/72 英寸)下有效链接,则返回一个有效链接;否则返回无效链接。换句话说,这个函数对于拾取和鼠标点击或悬停处理非常有用。
[重载虚函数] int QPdfLinkModel::rowCount(const QModelIndex &parent) const
重写: QAbstractItemModel::rowCount(const QModelIndex &parent) const.
© 2024 The Qt Company Ltd. 本文档中的贡献著作权归各自所属者所有。本手册提供的内容受GNU自由文档许可证版本1.3 的许可,该许可证由自由软件基金会发布。Qt及其相关标志是The Qt Company Ltd.在芬兰和/或其他国家的商标。所有其他商标均为其各自所有者的财产。