Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Qt for Python
Logo
Qt for Python
  • 入门指南
  • 商业用途
  • 从源代码构建
  • 包详情
  • 模块 API
    • Qt for Python 支持的 Qt 模块
      • PySide6.Qt3DAnimation
      • PySide6.Qt3DCore
      • PySide6.Qt3DExtras
      • PySide6.Qt3DInput
      • PySide6.Qt3DLogic
      • PySide6.Qt3DRender
      • PySide6.QtAsyncio
      • PySide6.QtBluetooth
      • PySide6.QtCharts
      • PySide6.QtCoap
      • PySide6.QtConcurrent
      • PySide6.QtCore
      • PySide6.QtDBus
      • PySide6.QtDesigner
      • PySide6.QtGraphs
      • PySide6.QtGraphsWidgets
      • PySide6.QtGui
      • PySide6.QtHelp
      • PySide6.QtHttpServer
      • PySide6.QtLocation
      • PySide6.QtMqtt
      • PySide6.QtMultimedia
      • PySide6.QtMultimediaWidgets
      • PySide6.QtNetwork
      • PySide6.QtNetworkAuth
      • PySide6.QtNfc
      • PySide6.QtOpcUa
      • PySide6.QtOpenGL
      • PySide6.QtOpenGLWidgets
      • PySide6.QtPdf
        • PySide6.QtPdf.QPdfBookmarkModel
        • PySide6.QtPdf.QPdfDocument
        • PySide6.QtPdf.QPdfDocumentRenderOptions
        • PySide6.QtPdf.QPdfLink
        • PySide6.QtPdf.QPdfLinkModel
        • PySide6.QtPdf.QPdfPageNavigator
        • PySide6.QtPdf.QPdfPageRenderer
        • PySide6.QtPdf.QPdfSearchModel
        • PySide6.QtPdf.QPdfSelection
      • PySide6.QtPdfWidgets
      • PySide6.QtPositioning
      • PySide6.QtPrintSupport
      • PySide6.QtQml
      • PySide6.QtQuick
      • PySide6.QtQuick3D
      • PySide6.QtQuickControls2
      • PySide6.QtQuickTest
      • PySide6.QtQuickWidgets
      • PySide6.QtRemoteObjects
      • PySide6.QtScxml
      • PySide6.QtSensors
      • PySide6.QtSerialBus
      • PySide6.QtSerialPort
      • PySide6.QtSpatialAudio
      • PySide6.QtSql
      • PySide6.QtStateMachine
      • PySide6.QtSvg
      • PySide6.QtSvgWidgets
      • PySide6.QtTest
      • PySide6.QtTextToSpeech
      • PySide6.QtUiTools
      • PySide6.QtWebChannel
      • PySide6.QtWebEngineCore
      • PySide6.QtWebEngineQuick
      • PySide6.QtWebEngineWidgets
      • PySide6.QtWebSockets
      • PySide6.QtWebView
      • PySide6.QtWidgets
      • PySide6.QtXml
  • 工具
  • Tutorials
  • 示例
  • 视频
  • 部署
  • 注意事项
  • 开发者笔记
  • 发布说明
  • 模块索引
Back to top

PySide6.QtPdf.QPdfLink¶

class QPdfLink¶

QPdfLink 类定义了页面上的一个区域(例如超链接或搜索结果)与目标(页面、页面上的位置以及查看时的缩放级别)之间的链接。更多…

概要¶

属性¶

  • contextAfterᅟ

  • contextBeforeᅟ

  • locationᅟ

  • pageᅟ

  • rectanglesᅟ

  • urlᅟ

  • validᅟ

  • zoomᅟ

方法¶

  • def __init__()

  • def contextAfter()

  • def contextBefore()

  • def copyToClipboard()

  • def isValid()

  • def location()

  • def page()

  • def rectangles()

  • def swap()

  • def toString()

  • def url()

  • def zoom()

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述¶

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property contextAfterᅟ: str¶

此属性保存搜索字符串后在页面上找到的相邻文本。如果链接是超链接,则此字符串为空。

另请参阅

resultsOnPage() resultAtIndex()

Access functions:
  • contextAfter()

property contextBeforeᅟ: str¶

此属性保存搜索字符串之前在页面上找到的相邻文本。如果链接是超链接,则此字符串为空。

另请参阅

resultsOnPage() resultAtIndex()

Access functions:
  • contextBefore()

property locationᅟ: QPointF¶

此属性保存page上的位置,以点为单位。如果链接是搜索结果,则是找到结果的位置;如果链接是超链接,则是目标位置。

Access functions:
  • location()

property pageᅟ: int¶

此属性保存页码。如果链接是搜索结果,则它是找到结果的页码;如果链接是超链接,则它是目标页码。

Access functions:
  • page()

property rectanglesᅟ: list of QRectF¶

此属性保存链接或搜索结果在页面上占据的区域(一组矩形)。如果文本在页面上换行到多行,可能会有多个矩形:

../../_images/wrapping-search-result.png

另请参阅

resultsOnPage() resultAtIndex()

Access functions:
  • rectangles()

property urlᅟ: QUrl¶

如果链接是外部超链接,则此属性保存目标URL;否则,它为空。

Access functions:
  • url()

property validᅟ: bool¶

此属性表示链接是否有效。

Access functions:
  • isValid()

property zoomᅟ: float¶

此属性保存建议的放大级别,其中1.0表示默认比例(1像素=1点)。如果链接是搜索结果,则不使用此值。

Access functions:
  • zoom()

__init__()¶

构造一个无效的 Destination。

另请参阅

valid

__init__(other)
Parameters:

其他 – QPdfLink

contextAfter()¶
Return type:

字符串

属性 contextAfterᅟ 的获取器。

contextBefore()¶
Return type:

字符串

属性 contextBeforeᅟ 的获取器。

copyToClipboard([mode=QClipboard.Clipboard])¶
Parameters:

mode – Mode

根据给定的mode,将链接的toString()表示复制到系统剪贴板。

isValid()¶
Return type:

布尔

属性 validᅟ 的获取器。

location()¶
Return type:

QPointF

属性 locationᅟ 的获取器。

page()¶
Return type:

整数

属性 pageᅟ 的获取器。

rectangles()¶
Return type:

QRectF的列表

属性 rectanglesᅟ 的获取器。

swap(other)¶
Parameters:

其他 – QPdfLink

toString()¶
Return type:

字符串

返回用于显示的翻译表示。

另请参阅

copyToClipboard()

url()¶
Return type:

QUrl

属性 urlᅟ 的获取器。

zoom()¶
Return type:

浮点数

属性 zoomᅟ 的获取器。

Next
PySide6.QtPdf.QPdfLinkModel
Previous
PySide6.QtPdf.QPdfDocumentRenderOptions
On this page
  • PySide6.QtPdf.QPdfLink
    • QPdfLink
      • QPdfLink.contextAfterᅟ
      • QPdfLink.contextBeforeᅟ
      • QPdfLink.locationᅟ
      • QPdfLink.pageᅟ
      • QPdfLink.rectanglesᅟ
      • QPdfLink.urlᅟ
      • QPdfLink.validᅟ
      • QPdfLink.zoomᅟ
      • QPdfLink.__init__()
      • QPdfLink.contextAfter()
      • QPdfLink.contextBefore()
      • QPdfLink.copyToClipboard()
      • QPdfLink.isValid()
      • QPdfLink.location()
      • QPdfLink.page()
      • QPdfLink.rectangles()
      • QPdfLink.swap()
      • QPdfLink.toString()
      • QPdfLink.url()
      • QPdfLink.zoom()