diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2022-09-14 16:16:09 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2022-09-15 15:08:20 +0000 |
commit | 0fab5956ea91dc0ee40b4d99605ec26a3720c5c8 (patch) | |
tree | ed9d8255baa8553d4d39a7685af3cc81746f802f /src/libs/cplusplus | |
parent | 2369dcc3242ce11e4e06bc6b1b3350ada5b785d6 (diff) | |
download | qt-creator-0fab5956ea91dc0ee40b4d99605ec26a3720c5c8.tar.gz |
CppEditor: Store typedefed name for anonymous structs
... and use it as the struct display name in some places.
Fixes: QTCREATORBUG-26611
Change-Id: I1b127f5705307a0fabd2441ff871162c882927a5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/cplusplus')
-rw-r--r-- | src/libs/cplusplus/LookupContext.cpp | 5 | ||||
-rw-r--r-- | src/libs/cplusplus/TypePrettyPrinter.cpp | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 3c12070e91..4b34f6f0bb 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -53,7 +53,10 @@ static void path_helper(Symbol *symbol, if (ns && ns->isInline()) return; } - addNames(symbol->name(), names); + if (symbol->asClass()) + addNames(symbol->asClass()->prettyName(), names); + else + addNames(symbol->name(), names); } else if (symbol->asObjCClass() || symbol->asObjCBaseClass() || symbol->asObjCProtocol() || symbol->asObjCForwardClassDeclaration() || symbol->asObjCForwardProtocolDeclaration() diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp index 41fb22c86b..64bc192b80 100644 --- a/src/libs/cplusplus/TypePrettyPrinter.cpp +++ b/src/libs/cplusplus/TypePrettyPrinter.cpp @@ -166,7 +166,7 @@ void TypePrettyPrinter::visit(Template *type) void TypePrettyPrinter::visit(Class *classTy) { - _text.prepend(overview()->prettyName(classTy->name())); + _text.prepend(overview()->prettyName(classTy->prettyName())); prependCv(_fullySpecifiedType); } |