/Qt 5.15

QPdfSelection Class

The QPdfSelection class defines a range of text that has been selected on one page in a PDF document, and its geometric boundaries. More...

Header: #include <QPdfSelection>
Since: Qt 5.15

This class was introduced in Qt 5.15.


  • bounds : const QVector<QPolygonF>
  • text : const QString
  • valid : const bool

Public Functions

QRectF boundingRectangle() const
QVector<QPolygonF> bounds() const
void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const
int endIndex() const
bool isValid() const
int startIndex() const
QString text() const

Detailed Description

See also QPdfDocument::getSelection().

Property Documentation

bounds : const QVector<QPolygonF>

This property holds a set of regions that the selected text occupies on the page, represented as polygons. The coordinate system for the polygons has the origin at the upper-left corner of the page, and the units are points.

Note: For now, the polygons returned from QPdfDocument::getSelection() are always rectangles; but in the future it may be possible to represent more complex regions.

Access functions:

QVector<QPolygonF> bounds() const

text : const QString

This property holds the selected text.

Access functions:

QString text() const

valid : const bool

This property holds whether the selection is valid.

Access functions:

bool isValid() const

Member Function Documentation

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

Copies text to the system clipboard.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.