逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
I wonder if there is a way to have a view of the project tree, showing subdirectories. In our project, we have many different classes that are each in a different directory. Being able to get those subdirectories to show would be useful to find the file we want to edit.

方法: I'm using .pri file in each subdirectory instead of .pro.
[Your main .pro file]
TEMPLATE = app
include(foo/foo.pri)
SOURCES += main.cpp \ ...

DEPENDPATH += foo [not sure, it is necessary] 可以不用
INCLUDEPATH += foo [not sure, it is necessary] 可以不用

[foo.pri]
HEADERS += $$PWD/foo.h
SOURCES += $$PWD/foo.cpp
注: $$PWD/必须要用, 否则是显示不出目录结构的, 这个在Windows, Mac下都能起作用, 想必在Linux也同样有效.

什么是.pri文件呢?
Thanks for the hint, but what exactly are .pri files, I often see them
around, but I haven't found anywhere in the documentation where they are
mentioned. Is there a place I can learn about them?
It's just a naming convention for junks of .pro files that are supposed
to be included using 'include(...)' in 'real' .pro files, 'real' meaning
'having a TARGET=... line'.
.pri文件其实就是把.pro文件的后缀改成.pri, .pro文件中使用include(xxx/xxx.pri)和有TARGET=xzy这两行.
The .pri file contains the list of source files, header files, .ui files, and .qrc files in the project. Developers on platforms other than Windows can add or remove files to the project by editing the .pri file.
posted on 2009-05-17 16:49 逛奔的蜗牛 阅读(6024) 评论(0)  编辑 收藏 引用 所属分类: Qt

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理