QPdfLink Class
QPdfLink 类定义了页面上的区域(如超链接或搜索结果)与目标(页面、页面上的位置以及查看页面的缩放级别)之间的链接。更多
Header: | #include <QPdfLink> |
Since: | Qt 6.4 |
属性
|
|
公共功能
QPdfLink() | |
QString | contextAfter() const |
QString | contextBefore() const |
void | copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const |
bool | isValid() const |
QPointF | location() const |
int | page() const |
QList<QRectF> | rectangles() const |
QString | toString() const |
QUrl | url() const |
qreal | zoom() const |
属性文档
[read-only]
contextAfter : const QString
该属性用于保存搜索字符串后页面上的相邻文本。如果链接是超链接,则该字符串为空。
访问功能:
QString | contextAfter() const |
另请参阅 QPdfSearchModel::resultsOnPage() 和QPdfSearchModel::resultAtIndex()。
[read-only]
contextBefore : const QString
该属性包含搜索字符串之前页面上的相邻文本。如果链接是超链接,则该字符串为空。
访问功能:
QString | contextBefore() const |
另请参阅 QPdfSearchModel::resultsOnPage() 和QPdfSearchModel::resultAtIndex()。
[read-only]
location : const QPointF
该属性表示page 上的位置,单位为点。如果链接是搜索结果,则是找到结果的位置;如果链接是超链接,则是目的地位置。
访问功能:
QPointF | location() const |
[read-only]
page : const int
该属性包含页码。如果链接是搜索结果,则是搜索结果所在的页码;如果链接是超链接,则是目标页码。
访问功能:
int | page() const |
[read-only]
rectangles : const QList<QRectF>
该属性包含链接或搜索结果在页面上所占的区域(矩形集)。如果文本在页面上绕了多行,则可能有多个矩形:
访问功能:
QList<QRectF> | rectangles() const |
另请参阅 QPdfSearchModel::resultsOnPage() 和QPdfSearchModel::resultAtIndex()。
[read-only]
url : const QUrl
如果链接是外部超链接,该属性将保存目标 URL;否则,该属性为空。
访问功能:
QUrl | url() const |
[read-only]
valid : const bool
此属性表示链接是否有效。
访问功能:
bool | isValid() const |
[read-only]
zoom : const qreal
此属性保存建议的放大级别,其中 1.0 表示默认比例(1 像素 = 1 点)。如果链接是搜索结果,则不使用此值。
访问函数:
qreal | zoom() const |
成员函数文档
QPdfLink::QPdfLink()
构造一个无效的 Destination。
另请参阅 valid 。
[invokable]
void QPdfLink::copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const
根据给定的mode ,将链接的toString() 表示复制到system clipboard 。
注: 可通过元对象系统和 QML 调用该函数。请参阅Q_INVOKABLE 。
[invokable]
QString QPdfLink::toString() const
返回翻译后的表示形式,以供显示。
注: 可通过元对象系统和 QML 调用此函数。参见Q_INVOKABLE 。
另请参阅 copyToClipboard() 。
© 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.