Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPdfLink Class Reference

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...

#include <qpdflink.h>

+ Collaboration diagram for QPdfLink:

Public Member Functions

Q_PDF_EXPORT QPdfLink ()
 Constructs an invalid Destination.
 
Q_PDF_EXPORT ~QPdfLink ()
 
Q_PDF_EXPORT QPdfLinkoperator= (const QPdfLink &other)
 
Q_PDF_EXPORT QPdfLink (const QPdfLink &other) noexcept
 
Q_PDF_EXPORT QPdfLink (QPdfLink &&other) noexcept
 
void swap (QPdfLink &other) noexcept
 
Q_PDF_EXPORT bool isValid () const
 
Q_PDF_EXPORT int page () const
 
Q_PDF_EXPORT QPointF location () const
 
Q_PDF_EXPORT qreal zoom () const
 
Q_PDF_EXPORT QUrl url () const
 
Q_PDF_EXPORT QString contextBefore () const
 
Q_PDF_EXPORT QString contextAfter () const
 
Q_PDF_EXPORT QList< QRectFrectangles () const
 
Q_PDF_EXPORT Q_INVOKABLE QString toString () const
 Returns a translated representation for display.
 
Q_PDF_EXPORT Q_INVOKABLE void copyToClipboard (QClipboard::Mode mode=QClipboard::Clipboard) const
 Copies the toString() representation of the link to the \l {QGuiApplication::clipboard()}{system clipboard} depending on the mode given.
 

Properties

bool valid
 This property holds whether the link is valid.
 
int page
 This property holds the page number.
 
QPointF location
 This property holds the location on the \l page, in units of points.
 
qreal zoom
 This property holds the suggested magnification level, where 1.0 means default scale (1 pixel = 1 point).
 
QUrl url
 This property holds the destination URL if the link is an external hyperlink; otherwise, it's empty.
 
QString contextBefore
 This property holds adjacent text found on the page before the search string.
 
QString contextAfter
 This property holds adjacent text found on the page after the search string.
 
QList< QRectFrectangles
 This property holds the region (set of rectangles) occupied by the link or search result on the page where it was found.
 

Friends

class QPdfDocument
 
class QPdfLinkModelPrivate
 
class QPdfSearchModelPrivate
 
class QPdfPageNavigator
 
class QQuickPdfPageNavigator
 

Detailed Description

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).

Since
6.4 \inmodule QtPdf

Definition at line 20 of file qpdflink.h.

Constructor & Destructor Documentation

◆ QPdfLink() [1/3]

QPdfLink::QPdfLink ( )

Constructs an invalid Destination.

See also
valid

Definition at line 27 of file qpdflink.cpp.

◆ ~QPdfLink()

QPdfLink::~QPdfLink ( )
default

◆ QPdfLink() [2/3]

QPdfLink::QPdfLink ( const QPdfLink & other)
defaultnoexcept

◆ QPdfLink() [3/3]

QPdfLink::QPdfLink ( QPdfLink && other)
defaultnoexcept

Member Function Documentation

◆ contextAfter()

QString QPdfLink::contextAfter ( ) const

Definition at line 127 of file qpdflink.cpp.

References QPdfLinkPrivate::contextAfter.

◆ contextBefore()

QString QPdfLink::contextBefore ( ) const

Definition at line 114 of file qpdflink.cpp.

References QPdfLinkPrivate::contextBefore.

◆ copyToClipboard()

void QPdfLink::copyToClipboard ( QClipboard::Mode mode = QClipboard::Clipboard) const

Copies the toString() representation of the link to the \l {QGuiApplication::clipboard()}{system clipboard} depending on the mode given.

Definition at line 166 of file qpdflink.cpp.

References QGuiApplication::clipboard(), and toString().

+ Here is the call graph for this function:

◆ isValid()

bool QPdfLink::isValid ( ) const

Definition at line 55 of file qpdflink.cpp.

References QPdfLinkPrivate::page.

Referenced by QQuickPdfSearchModel::setCurrentResult().

+ Here is the caller graph for this function:

◆ location()

QPointF QPdfLink::location ( ) const

Definition at line 79 of file qpdflink.cpp.

References QPdfLinkPrivate::location.

◆ operator=()

QPdfLink & QPdfLink::operator= ( const QPdfLink & other)
default

◆ page()

int QPdfLink::page ( ) const

Definition at line 67 of file qpdflink.cpp.

References QPdfLinkPrivate::page.

◆ rectangles()

QList< QRectF > QPdfLink::rectangles ( ) const

Definition at line 143 of file qpdflink.cpp.

References QPdfLinkPrivate::rects.

◆ swap()

void QPdfLink::swap ( QPdfLink & other)
inlinenoexcept

Definition at line 41 of file qpdflink.h.

References other(), and QExplicitlySharedDataPointer< T >::swap().

+ Here is the call graph for this function:

◆ toString()

QString QPdfLink::toString ( ) const

Returns a translated representation for display.

See also
copyToClipboard()

Definition at line 153 of file qpdflink.cpp.

References QString::arg(), QPdfLinkPrivate::location, QPdfLinkPrivate::page, QUrl::toString(), QPdfLinkPrivate::url, QPointF::x(), QPointF::y(), and QPdfLinkPrivate::zoom.

Referenced by copyToClipboard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ url()

QUrl QPdfLink::url ( ) const

Definition at line 101 of file qpdflink.cpp.

References QPdfLinkPrivate::url.

◆ zoom()

qreal QPdfLink::zoom ( ) const

Definition at line 90 of file qpdflink.cpp.

References QPdfLinkPrivate::zoom.

Friends And Related Symbol Documentation

◆ QPdfDocument

friend class QPdfDocument
friend

Definition at line 58 of file qpdflink.h.

◆ QPdfLinkModelPrivate

friend class QPdfLinkModelPrivate
friend

Definition at line 59 of file qpdflink.h.

◆ QPdfPageNavigator

friend class QPdfPageNavigator
friend

Definition at line 61 of file qpdflink.h.

◆ QPdfSearchModelPrivate

friend class QPdfSearchModelPrivate
friend

Definition at line 60 of file qpdflink.h.

◆ QQuickPdfPageNavigator

friend class QQuickPdfPageNavigator
friend

Definition at line 62 of file qpdflink.h.

Property Documentation

◆ contextAfter

QPdfLink::contextAfter
read

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
QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()

Definition at line 29 of file qpdflink.h.

Referenced by operator<<().

◆ contextBefore

QPdfLink::contextBefore
read

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
QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()

Definition at line 28 of file qpdflink.h.

Referenced by operator<<().

◆ location

QPdfLink::location
read

This property holds the location on the \l 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.

Definition at line 25 of file qpdflink.h.

Referenced by operator<<().

◆ page

QPdfLink::page
read

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.

Definition at line 24 of file qpdflink.h.

Referenced by operator<<(), and QQuickPdfSearchModel::setCurrentResult().

◆ rectangles

QPdfLink::rectangles
read

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:

See also
QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()

Definition at line 30 of file qpdflink.h.

Referenced by operator<<().

◆ url

QPdfLink::url
read

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

Definition at line 27 of file qpdflink.h.

◆ valid

QPdfLink::valid
read

This property holds whether the link is valid.

Definition at line 23 of file qpdflink.h.

◆ zoom

QPdfLink::zoom
read

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.

Definition at line 26 of file qpdflink.h.

Referenced by operator<<().


The documentation for this class was generated from the following files: