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
qpdfbookmarkmodel.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 QPDFBOOKMARKMODEL_H
5#define QPDFBOOKMARKMODEL_H
6
7#include <QtPdf/qtpdfglobal.h>
8#include <QtCore/qabstractitemmodel.h>
9
11
12class QPdfDocument;
14
15class Q_PDF_EXPORT QPdfBookmarkModel : public QAbstractItemModel
16{
18
19 Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
20
21public:
22 enum class Role : int
23 {
24 Title = Qt::UserRole,
25 Level,
26 Page,
27 Location,
28 Zoom,
29 NRoles
30 };
31 Q_ENUM(Role)
32
34 explicit QPdfBookmarkModel(QObject *parent);
36
37 QPdfDocument* document() const;
38 void setDocument(QPdfDocument *document);
39
40 QVariant data(const QModelIndex &index, int role) const override;
41 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
42 QModelIndex parent(const QModelIndex &index) const override;
43 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
44 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
45 QHash<int, QByteArray> roleNames() const override;
46
49
50private:
51 std::unique_ptr<QPdfBookmarkModelPrivate> d;
52
53 Q_PRIVATE_SLOT(d, void _q_documentStatusChanged())
54
56};
57
59
60#endif
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
The QPdfBookmarkModel class holds a tree of of links (anchors) within a PDF document,...
void documentChanged(QPdfDocument *document)
~QPdfBookmarkModel() override
Destroys the model.
Role
\value Title The name of the bookmark for display.
The QPdfDocument class loads a PDF document and renders pages from it.
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
@ UserRole
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS