Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qpdflinkmodel.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 QPDFLINKMODEL_H
5#define QPDFLINKMODEL_H
6
7#include <QtPdf/qtpdfglobal.h>
8#include <QtPdf/qpdfdocument.h>
9#include <QtPdf/qpdflink.h>
10
11#include <QtCore/QAbstractListModel>
12
14
16
18{
20 Q_PROPERTY(QPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
21 Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
22
23public:
24 enum class Role : int {
25 Link = Qt::UserRole,
26 Rectangle,
27 Url,
28 Page,
29 Location,
30 Zoom,
31 NRoles
32 };
33 Q_ENUM(Role)
34 explicit QPdfLinkModel(QObject *parent = nullptr);
36
37 QPdfDocument *document() const;
38
39 QHash<int, QByteArray> roleNames() const override;
40 int rowCount(const QModelIndex &parent) const override;
41 QVariant data(const QModelIndex &index, int role) const override;
42
43 int page() const;
44
45 QPdfLink linkAt(QPointF point) const;
46
47public Q_SLOTS:
48 void setDocument(QPdfDocument *document);
49 void setPage(int page);
50
53 void pageChanged(int page);
54
55private Q_SLOTS:
56 void onStatusChanged(QPdfDocument::Status status);
57
58private:
59 Q_DECLARE_PRIVATE(QPdfLinkModel)
60};
61
63
64#endif // QPDFLINKMODEL_H
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual QHash< int, QByteArray > roleNames() const
\inmodule QtCore
Definition qhash.h:818
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:90
The QPdfDocument class loads a PDF document and renders pages from it.
Status
This enum describes the current status of the document.
The QPdfLinkModel class holds the geometry and the destination for each link that the specified \l pa...
void pageChanged(int page)
Role
\value Link A QPdfLink object.
void documentChanged()
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore
Definition qvariant.h:64
Combined button and popup list for selecting options.
@ UserRole
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
#define Q_PDF_EXPORT
Definition qtpdfglobal.h:16
QByteArray page
[45]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent