当前位置:网站首页>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/wizardsLocal user configuration folder
Linux And macOS System :
$HOME/.config/QtProject/qtcreator/templates/wizardsWindows 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
边栏推荐
- C language learning
- go time包常用函数
- Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
- 串联二极管,提高耐压
- Extract the file name under the folder under win
- 数据湖(十五):Spark与Iceberg整合写操作
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- Dependency injection
- How did a fake offer steal $540million from "axie infinity"?
- 神奇快速幂
猜你喜欢

Restricted linear table

数据湖(十五):Spark与Iceberg整合写操作

One click free translation of more than 300 pages of PDF documents

激光slam学习(2D/3D、偏实践)

Apng2gif solutions to various problems

BSS 7230 flame retardant performance test of aviation interior materials

One click installation with fishros in blue bridge ROS

Magic fast power

Ping error: unknown name or service

快速回复二极管整流特性
随机推荐
C - linear table
Jisuan Ke - t3104
P2141 [noip2014 popularization group] abacus mental arithmetic test
Dependency injection
95. (cesium chapter) cesium dynamic monomer-3d building (building)
DataGuard active / standby cleanup archive settings
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
蓝桥ROS中使用fishros一键安装
@Configuration注解的详细介绍
HDU - 1260 tickets (linear DP)
Display the server hard disk image to the browser through Servlet
Extract the file name under the folder under win
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
C语言学习
Basic learning of SQL Server -- creating databases and tables with the mouse
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
Pigsty:开箱即用的数据库发行版
One click installation with fishros in blue bridge ROS
Oracle statistics by time
光流传感器初步测试:GL9306