[Qt-creator] How to extract VC-like project list?

dydx 549088764 at qq.com
Sun May 25 03:20:13 CEST 2014


Hi all,

I found the projects in Qt creator can be organized into a tree structure, but actually there are two kinds of "project" here, one ‍‍‍‍‍‍‍‍‍‍‍‍‍corresponding a "build target" and the other just a folder. For example, in the following image, "test1" and "test2" are the first kind, because you can compile them and get two .exe files, and "test" is just a folder, you can add a "real project" or another folder under it.
‍‍‍‍

I think these two kinds of projects are different but one can hardly ‍‍‍‍‍‍‍‍d‍‍i‍‍s‍t‍i‍n‍g‍u‍i‍s‍h them because their icons are the same.  I think this is not so good.

Now what I want to do is to extract all "real projects" ‍‍‍(projects corresponding a build target) from the project tree and make a VC-like project list, just as the following picture:
‍‍‍‍‍‍

I found there is a hasBuildTargets() function in ProjectExplorer::ProjectNode. So, I want to traverse the project tree and check this function, then throw the valid ones into a list. Is it right?

Another thing I want to do is to detect "project dependencies". For example, if project A  generates a .lib file and project B uses that file to generate a .exe, then I call project B "depends" project A.  How can I get these relationships? Do I have to parse .pro file ‍‍‍‍‍‍‍‍‍‍myself?

Best regards,
dydx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140525/1b59a121/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: F53F1E0A at FFF87A12.4D458153.jpg
Type: image/jpeg
Size: 32841 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140525/1b59a121/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C762A8CC at FFF87A12.4D458153.jpg
Type: image/jpeg
Size: 32824 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140525/1b59a121/attachment-0001.jpg>


More information about the Qt-creator mailing list