本页内容

QHelpIndexModel Class

QHelpIndexModel 类提供了一个模型,用于向视图提供索引关键词。更多内容...

标题: #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。

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