diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-02-16 16:33:22 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-02-18 18:20:43 +0100 |
commit | ea29dae17dd4238c259a05667ebd8ce7ca54b4fd (patch) | |
tree | b76e7a652955081f92079e776370adc2cb4cfd7f /tests | |
parent | 9202d454511fa917d7ede2e969c738c20e835675 (diff) | |
download | qttools-ea29dae17dd4238c259a05667ebd8ce7ca54b4fd.tar.gz |
qdoc: Store and use the current namespace scope for \fn comments
Writing \fn commands for member functions of classes declared under
a namespace was error-prone as QDoc required the fully qualified
paths for the function signature, even though the documentation
comment was located under the correct namespace scope.
Store the scope by backtracking the Clang AST until we reach the
level of the translation unit, and store each encountered namespace
declaration into a list. When generating the temporary source file
for an \fn command, we can then recreate the correct namespace
hierarchy.
This does not break the existing \fn command usage as it's perfectly
valid, even if unnecessary, to provide fully qualified paths in the
function signature.
[ChangeLog][qdoc] QDoc is now aware of the namespace scope of an \fn
command without requiring fully qualified paths.
Fixes: QTBUG-82190
Change-Id: Ia446c19d130b2ef48b16b67e4dfcbdaab1f9d4f5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdoc/generatedoutput/testcpp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qdoc/generatedoutput/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testcpp.cpp index b703a844b..5d3055ac2 100644 --- a/tests/auto/qdoc/generatedoutput/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testcpp.cpp @@ -156,7 +156,8 @@ void TestDerived::virtualFun() /*! \fn TestQDoc::Test::overload() - \fn TestQDoc::Test::overload(bool b) + \fn Test::overload(bool b) + //! The second overload should match even without the fully qualified path Overloads that share a documentation comment, optionally taking a parameter \a b. |