QHelpSearchResult Class
QHelpSearchResult 类提供了与搜索结果相关的数据。更多内容...
| 头文件: | #include <QHelpSearchResult> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Help) target_link_libraries(mytarget PRIVATE Qt6::Help) |
| qmake: | QT += help |
公共函数
| QHelpSearchResult() | |
| QHelpSearchResult(const QUrl &url, const QString &title, const QString &snippet) | |
| QHelpSearchResult(const QHelpSearchResult &other) | |
| ~QHelpSearchResult() | |
| QString | snippet() const |
| QString | title() const |
| QUrl | url() const |
| QHelpSearchResult & | operator=(const QHelpSearchResult &other) |
详细说明
QHelpSearchResult 对象是一个描述单个搜索结果的数据对象。QHelpSearchEngine::searchResults() 方法会返回一个搜索结果对象数组。搜索结果的描述包含与搜索输入匹配的文档标题和 URL,还包含文档内容中与搜索输入匹配度最高的片段。
另请参阅 QHelpSearchEngine 。
成员函数文档
QHelpSearchResult::QHelpSearchResult()
创建一个新的、空的 QHelpSearchResult 对象。
QHelpSearchResult::QHelpSearchResult(const QUrl &url, const QString &title, const QString &snippet)
生成包含url 、title 和snippet 的搜索结果,并将上述链接作为结果的描述。
QHelpSearchResult::QHelpSearchResult(const QHelpSearchResult &other)
创建other 的副本。
[noexcept] QHelpSearchResult::~QHelpSearchResult()
删除该搜索结果。
QString QHelpSearchResult::snippet() const
返回包含搜索结果中搜索词的文档片段。
QString QHelpSearchResult::title() const
返回搜索结果的文档标题。
QUrl QHelpSearchResult::url() const
返回搜索结果的文档 URL。
QHelpSearchResult &QHelpSearchResult::operator=(const QHelpSearchResult &other)
将 `other ` 赋值给此搜索结果,并返回对此搜索结果的引用。
© 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.