当前位置:网站首页>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-02437 failed to verify the primary key violation
- Connect diodes in series to improve voltage withstand
- 35岁那年,我做了一个面临失业的决定
- Ora-01741 and ora-01704
- archery安装测试
- [path planning] use the vertical distance limit method and Bessel to optimize the path of a star
- 【汇总】看过的一些Panel与视频
- BSS 7230 航空内饰材料阻燃性能测试
- Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
- Chisel tutorial - 00 Ex.scala metals plug-in (vs Code), SBT and coursier exchange endogenous
猜你喜欢
Kubectl 好用的命令行工具:oh-my-zsh 技巧和窍门
Ping error: unknown name or service
用語雀寫文章了,功能真心强大!
神奇快速幂
One click free translation of more than 300 pages of PDF documents
数据湖(十五):Spark与Iceberg整合写操作
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
At the age of 35, I made a decision to face unemployment
About the difference between ch32 library function and STM32 library function
【LeetCode】20、有效的括号
随机推荐
Svn relocation
Idea automatically generates serialVersionUID
Oracle statistics by time
Dataguard 主备清理归档设置
Gorm Association summary
HB 5469民用飞机机舱内部非金属材料燃烧试验方法
@Configuration注解的详细介绍
Restricted linear table
Pigsty:开箱即用的数据库发行版
Go time package common functions
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
一鍵免費翻譯300多頁的pdf文檔
神奇快速幂
Ora-01741 and ora-01704
webflux - webclient Connect reset by peer Error
Traduction gratuite en un clic de plus de 300 pages de documents PDF
Laser slam learning (2d/3d, partial practice)
Solutions to problems in sqlserver deleting data in tables
C language learning
Archery installation test