[Qt-creator] problem about symbol hierarchy

dydx 549088764 at qq.com
Sun Jan 19 07:03:33 CET 2014


Hello all,
I want to get an enhanced classView tree, which contains not only the hierarchy of projects, namespaces, classes and its members, but also the local variables of each function. How can I extract them? I have checked the functions in the ClassView::Internal::Parser and found that in its function addSymbol() all symbols with qualified name is ignored:

    const CPlusPlus::Name *symbolName = symbol->name();
    if (symbolName && symbolName->isQualifiedNameId() )
        return;

That is to say, all symbols in function bodys are unchecked, because member functions defined in .cpp file must have prefix like [Class Name]::, which is called qualified name in creator's source code.

I tried to cancel this, then all variables in functions are exposed, but in the classView tree, the function's node is not merged to its declaration node. That is, there are two separated nodes for one function, one is its declaration in the .h file, the other is its implementation in the .cpp file.

Then I tried to merge this two nodes, I found that in getParseProjectTree() each document's symbol tree will be merged.  But that didn't work because the scope hierarchy in cpp file can be incompleted. For example, when one declare using namespace A, then there's no need to write namespace A{ void classA::funA(){...}}, but write void classA::funA(){...} directly.

So how can I make the scope hierarchy completed in order to merge the function node? 

Best regards,
dydx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140119/7b59b84b/attachment.html>


More information about the Qt-creator mailing list