如何将整个目录添加到 QT Creator 项目中 [英] How do I add an entire directory to a QT creator project
问题描述
我有一个现有的 QT Creator 项目.我想将整个目录添加到这个项目中.我看到我可以右键单击项目文件浏览器树和添加现有文件..."但是通过这个对话框,我只能添加单个文件.如何包含整个目录?
I have an existing QT Creator project. I want to add an entire directory to this project. I see that I can right click in the project file browser tree and "Add Existing Files..." However through this dialog box, I can only add individual files. How can I include an entire directory?
推荐答案
最简单的方法是直接编辑你的.pro文件,添加HEADERS += mydir/*.h
和SOURCES+= mydir/*.cpp
并且整个目录的内容将显示在 QT Creator 中.进一步参考:http://qt-project.org/doc/qt-5/qmake-project-files.html
The simplest way is to directly edit your .pro file, add HEADERS += mydir/*.h
and SOURCES += mydir/*.cpp
and the contents of the whole directory will show up in QT Creator. Further reference: http://qt-project.org/doc/qt-5/qmake-project-files.html
这篇关于如何将整个目录添加到 QT Creator 项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!