QtCreator 自定义向导中的项目变量和配置 [英] project variables and configuration in QtCreator custom wizards

查看:112
本文介绍了QtCreator 自定义向导中的项目变量和配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用自定义向导(例如,Hello World"项目).除了包含我的文件和类之外,我还希望自动将一些额外的内容添加到生成的 .pro 文件中,例如 CONFIG+=compiler-configuration-stuffLIBS+=extra-needed-library,但文档对此没有任何说明.是否可以?怎么样?

I am creating a project template by using Custom Wizards (say, a "Hello World" project). Aside from including my files and classes, I would like some extra stuff to be automatically added to the generated .pro file, like CONFIG+=compiler-configuration-stuff or LIBS+=extra-needed-library, but the documentation does not say anything about this. Is it possible? How?

提前致谢.

推荐答案

您可以在向导中编辑 .pro 文件.向导文件位于以下目录中:

You can edit .pro file in your wizard. The wizard files are in the following directory:

Qt-Dir/Tools/QtCreator/share/qtcreator/templates/wizards/

如果您查看目录,有一些与不同向导相关的文件夹.例如,如果您查看helloworld/qmake"文件夹,您会看到一个project.pro"文件和一个wizard_sample.xml"文件.您可以编辑 xml 文件以拥有您的自定义向导.

If you look at the directory there are some folders related to different wizards. For example if you look in to the "helloworld/qmake" folder, there you can see a "project.pro" file and a "wizard_sample.xml" file. You can edit the xml file to have your custom wizard.

"project.pro" 是模板 pro 文件.您可以编辑它,下次您通过该向导创建项目时,将为该项目创建您的自定义专业版.

"project.pro" is a template pro file. You can edit it and next time you create a project by that wizard, your custom pro would be created for the project.

这篇关于QtCreator 自定义向导中的项目变量和配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆