diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-12-06 13:10:09 +0100 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-01-04 15:58:22 +0100 |
commit | 40725cfd6db30ccb06239a3fb04de80f1e8d276e (patch) | |
tree | 5f5ff5d80725dd53884f29c816871b8f4ee36e58 /src/shared/cplusplus/Bind.cpp | |
parent | 0edd253b615b485913d2bbb504a146f6aaa89c04 (diff) | |
download | qt-creator-40725cfd6db30ccb06239a3fb04de80f1e8d276e.tar.gz |
C++: Bind Q_ENUMS in the code model.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/shared/cplusplus/Bind.cpp')
-rw-r--r-- | src/shared/cplusplus/Bind.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index a21f73df18..c561455ec6 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1931,8 +1931,13 @@ bool Bind::visit(QtEnumDeclarationAST *ast) // unsigned enum_specifier_token = ast->enum_specifier_token; // unsigned lparen_token = ast->lparen_token; for (NameListAST *it = ast->enumerator_list; it; it = it->next) { - /*const Name *value =*/ this->name(it->value); + const Name *value = this->name(it->value); + if (!value) + continue; + QtEnum *qtEnum = control()->newQtEnum(it->value->firstToken(), value); + _scope->addMember(qtEnum); } + // unsigned rparen_token = ast->rparen_token; return false; } @@ -2833,6 +2838,7 @@ bool Bind::visit(EnumSpecifierAST *ast) { unsigned sourceLocation = location(ast->name, ast->firstToken()); const Name *enumName = this->name(ast->name); + Enum *e = control()->newEnum(sourceLocation, enumName); e->setStartOffset(tokenAt(sourceLocation).end()); // at the end of the enum or identifier token. e->setEndOffset(tokenAt(ast->lastToken() - 1).end()); |