简体   繁体   English

我可以使用自定义样板模板创建Qt Creator项目吗?

[英]Can I create a Qt Creator project with custom boilerplate template?

Is there any to change the default boilerplate code in the .cpp file when creating a new project in Qt Creator? 在Qt Creator中创建新项目时,是否可以更改.cpp文件中的默认样板代码?

Currently, new C++ projects open with: 当前,新的C ++项目以以下内容打开:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}

and I would like to change it. 我想更改它。

It's explained here https://doc.qt.io/qtcreator/creator-project-wizards.html and for C++ projects you'll find the default main.cpp boilerplate code in qtcreator/templates/wizards/projects/plaincpp . 在此处进行了说明https://doc.qt.io/qtcreator/creator-project-wizards.html ,对于C ++项目,您可以在qtcreator/templates/wizards/projects/plaincpp找到默认的main.cpp样板代码。

So basically you need to define a new custom wizard. 因此,基本上,您需要定义一个新的自定义向导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM