The QPdfLinkModel class holds the geometry and the destination for each link that the specified page contains. 更多...
头: | #include <QPdfLinkModel> |
Since: | 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 ) |
This is used in PDF viewers to implement the hyperlink mechanism.
常量 | 值 | 描述 |
---|---|---|
QPdfLinkModel::Role::Link
|
Qt::UserRole
|
A QPdfLink 对象。 |
QPdfLinkModel::Role::Rectangle
|
257
|
Bounding rectangle around the link. |
QPdfLinkModel::Role::Url
|
258
|
If the link is a web link, the URL for that; otherwise an empty URL. |
QPdfLinkModel::Role::Page
|
259
|
If the link is an internal link, the page number to which the link should jump; otherwise
-1
.
|
QPdfLinkModel::Role::Location
|
260
|
If the link is an internal link, the location on the page to which the link should jump. |
QPdfLinkModel::Role::Zoom
|
261
|
If the link is an internal link, the suggested zoom level on the destination page. |
This property holds the document to load links from.
访问函数:
QPdfDocument * | document () const |
void | setDocument (QPdfDocument * document ) |
通知程序信号:
void | documentChanged () |
This property holds the page to load links from.
访问函数:
int | page () const |
void | setPage (int page ) |
通知程序信号:
void | pageChanged (int page ) |
[explicit]
QPdfLinkModel::
QPdfLinkModel
(
QObject
*
parent
= nullptr)
Constructs a new link model with parent object parent .
[override virtual noexcept]
QPdfLinkModel::
~QPdfLinkModel
()
Destroys the model.
[override virtual]
QVariant
QPdfLinkModel::
data
(const
QModelIndex
&
index
,
int
role
) const
重实现: QAbstractItemModel::data(const QModelIndex &index, int role) const .
返回 valid link if found under the point (given in units of points, 1/72 of an inch), or an invalid link if it is not found. In other words, this function is useful for picking, to handle mouse click or hover.
[override virtual]
int
QPdfLinkModel::
rowCount
(const
QModelIndex
&
parent
) const
重实现: QAbstractItemModel::rowCount(const QModelIndex &parent) const .