当前位置:网站首页>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
边栏推荐
- Ora-01741 and ora-01704
- Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
- 机器人(自动化)等专业课程创新的结果
- At the age of 35, I made a decision to face unemployment
- 关于CH32库函数与STM32库函数的区别
- Introduction to programming hardware
- 【汇总】看过的一些Panel与视频
- Class C design questions
- Traduction gratuite en un clic de plus de 300 pages de documents PDF
- Binary sort tree [BST] - create, find, delete, output
猜你喜欢
[experiment sharing] log in to Cisco devices through the console port
Ora-01741 and ora-01704
Archery installation test
UIC564-2 附录4 –阻燃防火测试:火焰的扩散
DataGuard active / standby cleanup archive settings
如何衡量产品是否“刚需、高频、痛点”
One click free translation of more than 300 pages of PDF documents
神奇快速幂
Take you hand in hand to build feign with idea
第四期SFO销毁,Starfish OS如何对SFO价值赋能?
随机推荐
如何衡量产品是否“刚需、高频、痛点”
Solutions to problems in sqlserver deleting data in tables
SQL 使用in关键字查询多个字段
P1067 [noip2009 popularity group] polynomial output (difficult, pit)
limit 与offset的用法(转载)
@Configuration注解的详细介绍
关于CH32库函数与STM32库函数的区别
SQL uses the in keyword to query multiple fields
Installing gradle
光流传感器初步测试:GL9306
保证接口数据安全的10种方案
Introduction to programming hardware
Navicat connects Oracle
Database interview questions + analysis
2022.7.7-----leetcode.648
aws-aws help报错
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
一鍵免費翻譯300多頁的pdf文檔
C - Fibonacci sequence again
HB 5469 combustion test method for non-metallic materials in civil aircraft cabin