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
  • Getting Started
  • Commercial Use
  • Building from Source
  • Package Details
  • Modules API
    • Qt Modules Supported by Qt for Python
      • PySide6.Qt3DAnimation
      • PySide6.Qt3DCore
      • PySide6.Qt3DExtras
      • PySide6.Qt3DInput
      • PySide6.Qt3DLogic
      • PySide6.Qt3DRender
      • PySide6.QtAsyncio
      • PySide6.QtBluetooth
      • PySide6.QtConcurrent
      • PySide6.QtCore
      • PySide6.QtDBus
      • PySide6.QtDesigner
      • PySide6.QtGraphs
      • PySide6.QtGraphsWidgets
      • PySide6.QtGui
      • PySide6.QtHelp
      • PySide6.QtHttpServer
      • PySide6.QtLocation
      • PySide6.QtMultimedia
      • PySide6.QtMultimediaWidgets
      • PySide6.QtNetwork
      • PySide6.QtNetworkAuth
      • PySide6.QtNfc
      • 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
  • Tools
  • Tutorials
  • Examples
  • Videos
  • Deployment
  • Considerations
  • Developer Notes
  • Release Notes
  • Module Index
Back to top

PySide6.QtPdf.QPdfLink¶

class QPdfLink¶

The QPdfLink class defines a link between a region on a page (such as a hyperlink or a search result) and a destination (page, location on the page, and zoom level at which to view it). More…

Synopsis¶

Properties¶

  • contextAfterᅟ

  • contextBeforeᅟ

  • locationᅟ

  • pageᅟ

  • rectanglesᅟ

  • urlᅟ

  • validᅟ

  • zoomᅟ

Methods¶

  • def __init__()

  • def contextAfter()

  • def contextBefore()

  • def copyToClipboard()

  • def isValid()

  • def location()

  • def page()

  • def rectangles()

  • def swap()

  • def toString()

  • def url()

  • def zoom()

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description¶

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property contextAfterᅟ: str¶

This property holds adjacent text found on the page after the search string. If the link is a hyperlink, this string is empty.

See also

resultsOnPage() resultAtIndex()

Access functions:
  • contextAfter()

property contextBeforeᅟ: str¶

This property holds adjacent text found on the page before the search string. If the link is a hyperlink, this string is empty.

See also

resultsOnPage() resultAtIndex()

Access functions:
  • contextBefore()

property locationᅟ: QPointF¶

This property holds the location on the page , in units of points. If the link is a search result, it is the location where the result is found; if the link is a hyperlink, it is the destination location.

Access functions:
  • location()

property pageᅟ: int¶

This property holds the page number. If the link is a search result, it is the page number on which the result is found; if the link is a hyperlink, it is the destination page number.

Access functions:
  • page()

property rectanglesᅟ: list of QRectF¶

This property holds the region (set of rectangles) occupied by the link or search result on the page where it was found. If the text wraps around to multiple lines on the page, there may be multiple rectangles:

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

See also

resultsOnPage() resultAtIndex()

Access functions:
  • rectangles()

property urlᅟ: QUrl¶

This property holds the destination URL if the link is an external hyperlink; otherwise, it’s empty.

Access functions:
  • url()

property validᅟ: bool¶

This property holds whether the link is valid.

Access functions:
  • isValid()

property zoomᅟ: float¶

This property holds the suggested magnification level, where 1.0 means default scale (1 pixel = 1 point). If the link is a search result, this value is not used.

Access functions:
  • zoom()

__init__()¶

Constructs an invalid Destination.

See also

valid

__init__(other)
Parameters:

other – QPdfLink

contextAfter()¶
Return type:

str

Getter of property contextAfterᅟ .

contextBefore()¶
Return type:

str

Getter of property contextBeforeᅟ .

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

mode – Mode

Copies the toString() representation of the link to the system clipboard depending on the mode given.

isValid()¶
Return type:

bool

Getter of property validᅟ .

location()¶
Return type:

QPointF

Getter of property locationᅟ .

page()¶
Return type:

int

Getter of property pageᅟ .

rectangles()¶
Return type:

.list of QRectF

Getter of property rectanglesᅟ .

swap(other)¶
Parameters:

other – QPdfLink

toString()¶
Return type:

str

Returns a translated representation for display.

See also

copyToClipboard()

url()¶
Return type:

QUrl

Getter of property urlᅟ .

zoom()¶
Return type:

float

Getter of property zoomᅟ .

Next
PySide6.QtPdf.QPdfLinkModel
Previous
PySide6.QtPdf.QPdfDocumentRenderOptions
Copyright © 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 (https://www.gnu.org/licenses/fdl.html) 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.
Made with Sphinx and @pradyunsg's Furo
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()