QHelpSearchResult Class
QHelpSearchResult 类提供与搜索结果相关的数据。更多
Header: | #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 ,并返回对该搜索结果的引用。
© 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.