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
qpdfselection.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qpdfselection.h"
5#include "qpdfselection_p.h"
6#include <QGuiApplication>
7
9
27 : d(new QPdfSelectionPrivate())
28{
29}
30
37QPdfSelection::QPdfSelection(const QString &text, QList<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex)
38 : d(new QPdfSelectionPrivate(text, bounds, boundingRect, startIndex, endIndex))
39{
40}
41
43 : d(d)
44{
45}
46
51
58{
59 return !d->bounds.isEmpty();
60}
61
74QList<QPolygonF> QPdfSelection::bounds() const
75{
76 return d->bounds;
77}
78
85{
86 return d->text;
87}
88
98
105{
106 return d->startIndex;
107}
108
115{
116 return d->endIndex;
117}
118
119#if QT_CONFIG(clipboard)
124void QPdfSelection::copyToClipboard(QClipboard::Mode mode) const
125{
126 QGuiApplication::clipboard()->setText(d->text, mode);
127}
128#endif
129
131
132#include "moc_qpdfselection.cpp"
Mode
\keyword clipboard mode
Definition qclipboard.h:27
static QClipboard * clipboard()
Returns the object for interacting with the clipboard.
bool isEmpty() const noexcept
Definition qlist.h:401
QList< QPolygonF > bounds
The QPdfSelection class defines a range of text that has been selected on one page in a PDF document,...
Q_PDF_EXPORT ~QPdfSelection()
Q_PDF_EXPORT QPdfSelection & operator=(const QPdfSelection &other)
int startIndex
This property holds the index at the beginning of \l text within the full text on the page.
QString text
This property holds the selected text.
QList< QPolygonF > bounds
This property holds a set of regions that the selected text occupies on the page, represented as poly...
Q_PDF_EXPORT QPdfSelection(const QPdfSelection &other)
QRectF boundingRectangle
This property holds the overall bounding rectangle (convex hull) around \l bounds.
Q_PDF_EXPORT bool isValid() const
int endIndex
This property holds the index at the end of \l text within the full text on the page.
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
Combined button and popup list for selecting options.
GLenum mode
static const QRectF boundingRect(const QPointF *points, int pointCount)
QSharedPointer< T > other(t)
[5]