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
qquickpdfsearchmodel_p.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 QQUICKPDFSEARCHMODEL_P_H
5#define QQUICKPDFSEARCHMODEL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
19#include <QtPdfQuick/private/qquickpdfdocument_p.h>
20
21#include <QtPdf/qpdfsearchmodel.h>
22#include <QtQml/QQmlEngine>
23
25
27{
29 Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
30 Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged)
31 Q_PROPERTY(int currentResult READ currentResult WRITE setCurrentResult NOTIFY currentResultChanged)
32 Q_PROPERTY(QPdfLink currentResultLink READ currentResultLink NOTIFY currentResultLinkChanged)
33 Q_PROPERTY(QList<QPolygonF> currentPageBoundingPolygons READ currentPageBoundingPolygons NOTIFY currentPageBoundingPolygonsChanged)
34 Q_PROPERTY(QList<QPolygonF> currentResultBoundingPolygons READ currentResultBoundingPolygons NOTIFY currentResultBoundingPolygonsChanged)
35 Q_PROPERTY(QRectF currentResultBoundingRect READ currentResultBoundingRect NOTIFY currentResultBoundingRectChanged)
36 QML_NAMED_ELEMENT(PdfSearchModel)
38
39public:
40 explicit QQuickPdfSearchModel(QObject *parent = nullptr);
42
43 QQuickPdfDocument *document() const;
44 void setDocument(QQuickPdfDocument * document);
45
46 Q_INVOKABLE QList<QPolygonF> boundingPolygonsOnPage(int page);
47
48 int currentPage() const { return m_currentPage; }
49 void setCurrentPage(int currentPage);
50
51 int currentResult() const { return m_currentResult; }
52 void setCurrentResult(int currentResult);
53
54 QPdfLink currentResultLink() const;
55 QList<QPolygonF> currentPageBoundingPolygons() const;
56 QList<QPolygonF> currentResultBoundingPolygons() const;
57 QRectF currentResultBoundingRect() const;
58
66
67private:
68 void updateResults();
69 void onResultsChanged();
70
71private:
72 QQuickPdfDocument *m_quickDocument = nullptr;
73 int m_currentPage = 0;
74 int m_currentResult = 0;
75 bool m_suspendSignals = false;
76
77 Q_DISABLE_COPY(QQuickPdfSearchModel)
78};
79
81
84
85#endif // QQUICKPDFSEARCHMODEL_P_H
Definition qlist.h:75
\inmodule QtCore
Definition qobject.h:103
The QPdfSearchModel class searches for a string in a PDF document and holds the results.
The QPdfSelection class defines a range of text that has been selected on one page in a PDF document,...
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
void currentResultLinkChanged()
void currentResultBoundingPolygonsChanged()
void currentResultBoundingRectChanged()
void currentPageBoundingPolygonsChanged()
\inmodule QtCore\reentrant
Definition qrect.h:484
Combined button and popup list for selecting options.
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define signals
#define Q_PDFQUICK_EXPORT
#define explicit
QByteArray page
[45]