QHelpIndexModel Class

QHelpIndexModel 类提供了一个向视图提供索引关键字的模型。更多

Header: #include <QHelpIndexModel>
CMake: find_package(Qt6 REQUIRED COMPONENTS Help)
target_link_libraries(mytarget PRIVATE Qt6::Help)
qmake: QT += help
继承: QStringListModel

公共函数

void createIndex(const QString &filter)
(since 6.8) void createIndexForCurrentFilter()
QModelIndex filter(const QString &filter, const QString &wildcard = {})
QHelpEngineCore *helpEngine() const
bool isCreatingIndex() const

信号

详细说明

成员函数文档

void QHelpIndexModel::createIndex(const QString &filter)

通过查询帮助系统中指定自定义filter 名称的关键字创建新索引。

[since 6.8] void QHelpIndexModel::createIndexForCurrentFilter()

通过查询帮助系统中有关当前过滤器的关键字来创建新索引。

此函数在 Qt 6.8 中引入。

QModelIndex QHelpIndexModel::filter(const QString &filter, const QString &wildcard = {})

筛选索引并返回匹配度最高的关键词的模型索引。第一步,模型索引列表中只保留包含filter 的关键词。同样,如果wildcard 不为空,则索引列表中只保留匹配的关键词。第二步,确定最佳匹配,并返回其索引模型。在指定通配符表达式时,filter 字符串用于搜索最佳匹配。

QHelpEngineCore *QHelpIndexModel::helpEngine() const

返回管理此模型的相关帮助引擎。

[signal] void QHelpIndexModel::indexCreated()

该信号在索引创建完成后发出。

[signal] void QHelpIndexModel::indexCreationStarted()

当开始创建新索引时会发出该信号。在indexCreated() 信号发出前,当前索引无效。

另请参阅 isCreatingIndex() 。

bool QHelpIndexModel::isCreatingIndex() const

如果当前已建立索引,则返回 true,否则返回 false。

© 2025 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.