添加向导

Qt Creator 在《向导》中有用于添加类、文件和项目的向导,您可以复制并编辑这些向导来创建自己的向导。在用户设置目录下的 目录中创建向导templates/wizards/ 目录

在 C++ 类向导中定义类视图

创建新向导

  1. 使用-customwizard-verbose 参数启动Qt Creator ,以便在向导开发过程中接收反馈。更多信息,请参阅 "Verbose Output"。
  2. InspectFactory.Reset 操作设置键盘快捷方式,详见向导开发提示
  3. 复制包含向导的目录并重命名。例如,将share/qtcreator/templates/wizards/classes/cpp 复制为$HOME/.config/QtProject/qtcreator/templates/wizards/classes/mycpp
  4. 使用Factory.Reset 操作,使向导出现在File >New File 中,而无需重新启动Qt Creator
  5. 自定义向导中所述,打开向导配置文件wizard.json 进行编辑。
  6. 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.