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#

Methods#

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.

Access functions:
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.

Access functions:
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:
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:
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:

Access functions:
property urlᅟ: QUrl#

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

Access functions:
property validᅟ: bool#

This property holds whether the link is valid.

Access functions:
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:
__init__()#

Constructs an invalid Destination.

See also

valid

__init__(other)
Parameters:

otherQPdfLink

contextAfter()#
Return type:

str

Getter of property contextAfterᅟ .

contextBefore()#
Return type:

str

Getter of property contextBeforeᅟ .

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

modeMode

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:

otherQPdfLink

toString()#
Return type:

str

Returns a translated representation for display.

url()#
Return type:

QUrl

Getter of property urlᅟ .

zoom()#
Return type:

float

Getter of property zoomᅟ .