QPdfBookmarkModel 类

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

头: #include <QPdfBookmarkModel>
继承: QAbstractItemModel

公共类型

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

特性

公共函数

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

重实现公共函数

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

信号

void documentChanged (QPdfDocument * document )

详细描述

This is used in the 模型/视图编程 paradigm to display a table of contents in the form of a tree or list.

成员类型文档编制

enum class QPdfBookmarkModel:: Role

常量 描述
QPdfBookmarkModel::Role::Title Qt::UserRole The name of the bookmark for display.
QPdfBookmarkModel::Role::Level 257 The level of indentation.
QPdfBookmarkModel::Role::Page 258 The page number of the destination (int).
QPdfBookmarkModel::Role::Location 259 The position of the destination ( QPointF ).
QPdfBookmarkModel::Role::Zoom 260 The suggested zoom level (qreal).

特性文档编制

document : QPdfDocument *

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

访问函数:

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

通知程序信号:

void documentChanged (QPdfDocument * document )

成员函数文档编制

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

Constructs a new bookmark model with parent object parent .

[override virtual noexcept] QPdfBookmarkModel:: ~QPdfBookmarkModel ()

Destroys the model.

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

重实现: QAbstractItemModel::columnCount(const QModelIndex &parent) const .

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

重实现: QAbstractItemModel::data(const QModelIndex &index, int role) const .

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

重实现: QAbstractItemModel::index(int row, int column, const QModelIndex &parent) const .

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

重实现: QAbstractItemModel::parent(const QModelIndex &index) const .

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

重实现: QAbstractItemModel::roleNames() const .

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

重实现: QAbstractItemModel::rowCount(const QModelIndex &parent) const .