常见的扩展任务
本节总结了可用于向Qt Creator 添加UI组件的API函数。
| 任务 | 详细信息 | API |
|---|---|---|
| 添加菜单或菜单项。 | 您可以扩展现有菜单或创建新菜单。 | Core::ActionManager,Core::Command |
| 添加可配置的键盘快捷键。 | 注册快捷键后,用户便可在通用快捷键设置对话框中对其进行配置。 | Core::ActionManager,Core::Command |
| 添加一种模式。 | 模式对应于专为某项任务设计的完整控件屏幕。 | Core::IMode |
| 添加一种新的编辑器类型。 | 例如用于 XML 文件的编辑器。 | Core::IEditorFactory,Core::IEditor ,Core::IDocument |
| 添加一个新的向导。 | 您可以在File >New File 和New Project 中,使用您自己的文件和项目模板来扩展向导。我们建议您创建基于 JSON 的向导,而不是用 C++ 代码实现新的向导。 | Qt Creator: 添加向导 Core::IWizardFactory,Core::BaseFileWizardFactory,Core::BaseFileWizard,Core::WizardDialogParameters |
| 添加对新版本控制系统的支持。 | Qt Creator 中集成的版本控制系统包括 Bazaar、CVS、Git、Mercurial、Perforce 和 Subversion。 | Core::IVersionControl |
| 在导航侧边栏中添加一个视图。 | 该视图用于显示项目树、文件系统、已打开的文档或书签。 | Core::INavigationWidgetFactory |
| 在“Preferences ”对话框中添加一个页面。 | 在“Edit ” > “Preferences ”中,向现有或新建的类别添加新页面。 | Core::IOptionsPage |
| 在“Find ”对话框中添加一个查找过滤器。 | 实现基于任何类型搜索词的搜索功能。 | Core::IFindFilter,Core::SearchResultWindow |
| 为小部件添加对“查找”工具栏的支持。 | 系统会询问当前获得焦点的控件是否支持文本搜索。您可以为自己控制的控件添加此功能。 | Core::IFindSupport,Core::BaseTextFind |
| 在定位器中添加一个新过滤器。 | 针对用户输入的文本,您需提供要在弹出窗口中显示的选项列表。当用户选择某项时,系统会请求您执行相应的操作。 | Core::ILocatorFilter |
| 为并发运行的任务显示进度指示器。 | 您可以在左侧工具栏中显示任务的进度指示器,也可以在应用程序图标中显示(在支持该功能的平台上)。 | Core::ProgressManager,Core::FutureProgress |
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.