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.h
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#ifndef QPDFSELECTION_H
5#define QPDFSELECTION_H
6
7#include <QtPdf/qtpdfglobal.h>
8
9#include <QtCore/qobject.h>
10#include <QtCore/qshareddata.h>
11#include <QtGui/qclipboard.h>
12#include <QtGui/qpolygon.h>
13
15
17
19{
20 Q_GADGET_EXPORT(Q_PDF_EXPORT)
27
28public:
29 Q_PDF_EXPORT ~QPdfSelection();
30 Q_PDF_EXPORT QPdfSelection(const QPdfSelection &other);
31 Q_PDF_EXPORT QPdfSelection &operator=(const QPdfSelection &other);
32
33 Q_PDF_EXPORT QPdfSelection(QPdfSelection &&other) noexcept;
34 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPdfSelection)
35
36 void swap(QPdfSelection &other) noexcept { d.swap(other.d); }
37
38 Q_PDF_EXPORT bool isValid() const;
39 Q_PDF_EXPORT QList<QPolygonF> bounds() const;
40 Q_PDF_EXPORT QString text() const;
41 Q_PDF_EXPORT QRectF boundingRectangle() const;
42 Q_PDF_EXPORT int startIndex() const;
43 Q_PDF_EXPORT int endIndex() const;
44#if QT_CONFIG(clipboard)
45 Q_PDF_EXPORT void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
46#endif
47
48private:
50 QPdfSelection(const QString &text, QList<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex);
52 friend class QPdfDocument;
53 friend class QQuickPdfSelection;
54
55private:
56 QExplicitlySharedDataPointer<QPdfSelectionPrivate> d;
57};
58Q_DECLARE_SHARED(QPdfSelection)
59
61
62#endif // QPDFSELECTION_H
Mode
\keyword clipboard mode
Definition qclipboard.h:27
void swap(QExplicitlySharedDataPointer &other) noexcept
Swap this instance's explicitly shared data pointer with the explicitly shared data pointer in other.
Definition qlist.h:75
The QPdfDocument class loads a PDF document and renders pages from it.
The QPdfSelection class defines a range of text that has been selected on one page in a PDF document,...
void swap(QPdfSelection &other) noexcept
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...
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.
bool valid
This property holds whether the selection is valid.
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLenum mode
static const QRectF boundingRect(const QPointF *points, int pointCount)
#define Q_PROPERTY(...)
#define Q_GADGET_EXPORT(...)
QSharedPointer< T > other(t)
[5]