diff options
author | Martin Smith <martin.smith@qt.io> | 2016-11-18 11:46:51 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2017-08-10 07:33:34 +0000 |
commit | 85ddd7d2e36e2f9bd94c4a2fe572fe44c7573a12 (patch) | |
tree | ea6f45c19647cb9975a3e2347c0bbdc6822b8633 /src/qdoc/clangcodeparser.cpp | |
parent | 55e84aa7d3fdcee269cee7adb4f253fda2293667 (diff) | |
download | qttools-85ddd7d2e36e2f9bd94c4a2fe572fe44c7573a12.tar.gz |
qdoc: Match unqualified parameter types
clangqdoc was unable to tie qdoc comments to their
function declarations for nested classes, when the
function had a formal parameter of the nested class
type. The problem was that findNodeForCursor() didn't
handle the type name scoping correctly.
Change-Id: I64d81377193447b1af73ecd107f0431fac0d81a7
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 0f75724be..f72896dfd 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -208,12 +208,16 @@ static Node *findNodeForCursor(QDocDatabase* qdb, CXCursor cur) { args.append(fromCXString(clang_getTypeSpelling(clang_getArgType(funcType, i)))); QString t1 = funcParams.at(i).dataType(); QString t2 = args.at(i); + auto p2 = parent; + while (p2 && t1 != t2) { + QString parentScope = p2->name() + QLatin1String("::"); + t1 = t1.remove(parentScope); + t2 = t2.remove(parentScope); + p2 = p2->parent(); + } if (t1 != t2) { - QString parentScope = parent->name() + QLatin1String("::"); - if (t1.remove(parentScope) != t2.remove(parentScope)) { - different = true; - break; - } + different = true; + break; } } if (!different) |