添加向导
Qt Creator 在《向导》中有用于添加类、文件和项目的向导,您可以复制并编辑这些向导来创建自己的向导。在用户设置目录下的 目录中创建向导templates/wizards/
目录。
创建新向导
- 使用
-customwizard-verbose
参数启动Qt Creator ,以便在向导开发过程中接收反馈。更多信息,请参阅 "Verbose Output"。 - 为Inspect 和Factory.Reset 操作设置键盘快捷方式,详见向导开发提示。
- 复制包含向导的目录并重命名。例如,将
share/qtcreator/templates/wizards/classes/cpp
复制为$HOME/.config/QtProject/qtcreator/templates/wizards/classes/mycpp
。 - 使用Factory.Reset 操作,使向导出现在File >New File 中,而无需重新启动Qt Creator 。
- 如自定义向导中所述,打开向导配置文件
wizard.json
进行编辑。 - 将
id
改为唯一的。向导在category
中按 ID 的字母顺序排序。可以使用前导字母指定向导的位置。例如,B.MyClass
。
另请参阅 从命令行运行Qt Creator 和自定义向导。
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.