Core::IFindSupport Class
class Core::IFindSupportIFindSupport 类提供了在文档或控件中进行搜索的功能。更多内容...
| Header: | #include <coreplugin/find/ifindsupport.h> |
| Inherits: | QObject |
公共类型
| enum | Result { Found, NotFound, NotYetFound } |
公共函数
| virtual void | clearFindScope() |
| virtual void | clearHighlights() = 0 |
| virtual QString | completedFindString() const = 0 |
| virtual QString | currentFindString() const = 0 |
| virtual void | defineFindScope() |
| virtual Core::IFindSupport::Result | findIncremental(const QString &txt, Utils::FindFlags findFlags) = 0 |
| virtual Core::IFindSupport::Result | findStep(const QString &txt, Utils::FindFlags findFlags) = 0 |
| virtual void | highlightAll(const QString &txt, Utils::FindFlags findFlags) |
| virtual void | replace(const QString &before, const QString &after, Utils::FindFlags findFlags) |
| virtual int | replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags) |
| virtual bool | replaceStep(const QString &before, const QString &after, Utils::FindFlags findFlags) |
| virtual void | resetIncrementalSearch() = 0 |
| virtual void | selectAll(const QString &txt, Utils::FindFlags findFlags) |
| virtual Utils::FindFlags | supportedFindFlags() const = 0 |
| virtual bool | supportsReplace() const = 0 |
| virtual bool | supportsSelectAll() const |
信号
| void | changed() |
静态公共成员
| void | showWrapIndicator(QWidget *parent) |
另请参阅 Core::BaseTextFind 。
成员类型文档
enum IFindSupport::Result
该枚举用于表示是否在搜索范围内使用查找标志找到了搜索词。
| 常量 | 值 | 描述 |
|---|---|---|
Core::IFindSupport::Found | 0 | 找到了搜索词。 |
Core::IFindSupport::NotFound | 1 | 未找到搜索词。 |
Core::IFindSupport::NotYetFound | 2 | 尚未找到该搜索词。 |
成员函数文档
[signal] void IFindSupport::changed()
当搜索条件发生变化时,会发出此信号。
[virtual] void IFindSupport::clearFindScope()
清除查找范围。
[pure virtual] void IFindSupport::clearHighlights()
清除搜索小部件中搜索结果的高亮标记。
[pure virtual] QString IFindSupport::completedFindString() const
返回完整的搜索字符串。
[pure virtual] QString IFindSupport::currentFindString() const
返回当前的搜索字符串。
[virtual] void IFindSupport::defineFindScope()
定义查找范围。
[pure virtual] Core::IFindSupport::Result IFindSupport::findIncremental(const QString &txt, Utils::FindFlags findFlags)
使用findFlags 对搜索词“txt ”进行增量搜索。
[pure virtual] Core::IFindSupport::Result IFindSupport::findStep(const QString &txt, Utils::FindFlags findFlags)
使用findFlags 搜索txt 。
[virtual] void IFindSupport::highlightAll(const QString &txt, Utils::FindFlags findFlags)
在使用findFlags 时,会突出显示所有与“txt ”相关的搜索结果。
[virtual] void IFindSupport::replace(const QString &before, const QString &after, Utils::FindFlags findFlags)
根据findFlags 的规定,将before 替换为after 。
[virtual] int IFindSupport::replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags)
根据findFlags 中的规定,将所有before 替换为after 。
[virtual] bool IFindSupport::replaceStep(const QString &before, const QString &after, Utils::FindFlags findFlags)
根据findFlags 的规定,将before 替换为after ,然后执行findStep()。
返回“find”步骤是否找到了另一个匹配项。
[pure virtual] void IFindSupport::resetIncrementalSearch()
将增量搜索重置为起始位置。
[virtual] void IFindSupport::selectAll(const QString &txt, Utils::FindFlags findFlags)
查找并选中所有符合txt 且findFlags 为指定值的实例。
[static] void IFindSupport::showWrapIndicator(QWidget *parent)
显示parent ,并叠加了换行指示符。
[pure virtual] Utils::FindFlags IFindSupport::supportedFindFlags() const
返回此查找过滤器所支持的查找标志,例如整词或正则表达式。
根据返回值的不同,默认的查找选项控件会被启用或禁用。
默认情况下,这些选项包括 Uitls::FindBackward、Utils::FindCaseSensitively 、Uitls::FindRegularExpression、Uitls::FindWholeWords 和 Uitls::FindPreserveCase。
[pure virtual] bool IFindSupport::supportsReplace() const
返回该查找过滤器是否支持搜索和替换。
[virtual] bool IFindSupport::supportsSelectAll() const
返回该查找过滤器是否支持选中所有结果。
Copyright © The Qt Company Ltd. and other contributors. 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.