QPdfBookmarkModel Class

The QPdfBookmarkModel class holds a tree of of links (anchors) within a PDF document, such as the table of contents. More...

Header: #include <QPdfBookmarkModel>
Inherits: QAbstractItemModel

Public Types

enum class Role { Title, Level, Page, Location, Zoom }

Properties

Public Functions

QPdfBookmarkModel(QObject *parent)
virtual ~QPdfBookmarkModel() override
QPdfDocument *document() const
void setDocument(QPdfDocument *document)

Reimplemented Public Functions

virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override
virtual QVariant data(const QModelIndex &index, int role) const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override
virtual QModelIndex parent(const QModelIndex &index) const override
virtual QHash<int, QByteArray> roleNames() const override
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override

Signals

void documentChanged(QPdfDocument *document)

Detailed Description

This is used in the Model/View Programming paradigm to display a table of contents in the form of a tree or list.

Member Type Documentation

enum class QPdfBookmarkModel::Role

ConstantValueDescription
QPdfBookmarkModel::Role::TitleQt::UserRoleThe name of the bookmark for display.
QPdfBookmarkModel::Role::Level257The level of indentation.
QPdfBookmarkModel::Role::Page258The page number of the destination (int).
QPdfBookmarkModel::Role::Location259The position of the destination (QPointF).
QPdfBookmarkModel::Role::Zoom260The suggested zoom level (qreal).

Property Documentation

document : QPdfDocument*

This property holds the PDF document in which bookmarks are to be found.

Access functions:

QPdfDocument *document() const
void setDocument(QPdfDocument *document)

Notifier signal:

void documentChanged(QPdfDocument *document)

Member Function Documentation

[explicit] QPdfBookmarkModel::QPdfBookmarkModel(QObject *parent)

Constructs a new bookmark model with parent object parent.

[override virtual] QPdfBookmarkModel::~QPdfBookmarkModel()

Destroys the model.

[override virtual] int QPdfBookmarkModel::columnCount(const QModelIndex &parent = QModelIndex()) const

Reimplements: QAbstractItemModel::columnCount(const QModelIndex &parent) const.

[override virtual] QVariant QPdfBookmarkModel::data(const QModelIndex &index, int role) const

Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.

[override virtual] QModelIndex QPdfBookmarkModel::index(int row, int column, const QModelIndex &parent = QModelIndex()) const

Reimplements: QAbstractItemModel::index(int row, int column, const QModelIndex &parent) const.

[override virtual] QModelIndex QPdfBookmarkModel::parent(const QModelIndex &index) const

Reimplements: QAbstractItemModel::parent(const QModelIndex &index) const.

[override virtual] QHash<int, QByteArray> QPdfBookmarkModel::roleNames() const

Reimplements: QAbstractItemModel::roleNames() const.

[override virtual] int QPdfBookmarkModel::rowCount(const QModelIndex &parent = QModelIndex()) const

Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.