当前位置:网站首页>QT creator add custom new file / Project Template Wizard
QT creator add custom new file / Project Template Wizard
2022-07-07 23:52:00 【Raring_ Ringtail】
Qt Creator Add custom new file / Project Template Wizard
Translated from :https://doc.qt.io/qtcreator/creator-project-wizards.html
If you have a team that is building large applications or developing multiple applications , You may want to standardize the way team members create projects and documents .
You can copy the new wizard template in the template folder to create your own project wizard and file wizard . When you click File > New File or Project They will be New The dialog box displays .
In the customized new wizard , You can customize a series of wizard page user interfaces . The value filled in by the user in the wizard is assigned to the field name . Field names and values are then used during file creation .
Wizard type
In a project wizard , You can specify the files needed for a project . You can add wizard pages to allow developers to specify settings for the project .
The file wizard is similar to the project wizard , But it does not contain any project files .
It is recommended that you create one based on JSON Wizard for . It is based on XML Superset of wizard . More on :
Translation notes :(Qt Creator The steps and detailed documents of the new wizard are mainly in the following two articles , I translated it based on JSON Of )
- Add based on JSON Wizard for
- Add based on XML Wizard for ( obsolete )
Find the location of the wizard template
Wizard templates are located in subfolders of the following folder :
share/qtcreator/templates/wizards
/opt/Qt5.13.0/Tools/QtCreator/share/qtcreator/templates/wizards
Local user configuration folder
Linux And macOS System :
$HOME/.config/QtProject/qtcreator/templates/wizards
Windows System :
%APPDATA%\QtProject\qtcreator\templates\wizards
Be careful : If you're using a macOS, You can Qt Creator.app/Contents/Resources/templates/wizards
Find
Some skills of wizard development
Qt Creator There are some actions that can improve the wizard development process . They are not bound to shortcut keys by default , So it can't trigger . To enable them , You can set it after entering the shortcut key :Tools > Options > Environment > Keyboard > Wizard
The following actions can help the wizard develop :
operation | describe |
---|---|
Inspect | Triggering this operation will open a window , List all defined fields and variables in the wizard when the operation is triggered . for example , Each time this operation is triggered, a new modeless window opens , You can compare the status of different wizard pages . |
Factory.Reset | Triggering this operation will make Qt Creator Forget all the guide factories , Make it open in File > New File or Project Reload all wizard definitions . So you can change the wizard definition , Don't have to restart Qt Creator You can see the effect . |
Detailed output
When developing custom wizards ( Including based on JSON Based on XML Wizard for ), It is recommended to start Qt Creator When combined with -customwizard-verbose
Parameters . In this way, each wizard being set will produce the following output :
Be careful :
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
for wizard.json.
* Configuration found and parsed.
There is... In the output message wizard.json The name of the folder where the file is located . If no files are found , This message will not be displayed .
If there is an error in the file , For example, invalid icon address , The following information will be displayed :
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
for wizard.json.
* Configuration found and parsed.
* Failed to create: Icon file
"/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard/../.. /global/genericfilewizard.png" not found.
see Use command line options Get more information about command line parameters .
Welcome to my official account. : Notes on Jiangda
边栏推荐
- 2022.7.7-----leetcode.648
- Stringutils tool class
- Navicat connects Oracle
- Connect diodes in series to improve voltage withstand
- Jisuan Ke - t3104
- Enterprise application demand-oriented development of human resources department, employee attendance records and paid wages business process cases
- 平衡二叉树【AVL树】——插入、删除
- P1308 [noip2011 popularity group] count the number of words
- aws-aws help报错
- Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
猜你喜欢
Take you hand in hand to build Eureka server with idea
Connect diodes in series to improve voltage withstand
BSS 7230 航空内饰材料阻燃性能测试
Binary sort tree [BST] - create, find, delete, output
Chisel tutorial - 05 Sequential logic in chisel (including explicit multi clock, explicit synchronous reset and explicit asynchronous reset)
保证接口数据安全的10种方案
蓝桥ROS中使用fishros一键安装
Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
Chisel tutorial - 04 Control flow in chisel
10 schemes to ensure interface data security
随机推荐
FFA与ICGA造影
Data analysis series 3 σ Rule / eliminate outliers according to laida criterion
Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
ASP. Net query implementation
C language learning
Data Lake (XV): spark and iceberg integrate write operations
一键免费翻译300多页的pdf文档
2022.7.7-----leetcode. six hundred and forty-eight
Aitm3.0005 smoke toxicity test
第四期SFO销毁,Starfish OS如何对SFO价值赋能?
解析token的网址
SQL connection problem after downloading (2)
c—线性表
mysql8.0 ubuntu20.4
Connect diodes in series to improve voltage withstand
BSS 7230 航空内饰材料阻燃性能测试
数据分析系列 之3σ规则/依据拉依达准则来剔除异常值
The file format and extension of XLS do not match
One of the anti climbing methods
aws-aws help报错