From ea29dae17dd4238c259a05667ebd8ce7ca54b4fd Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Sun, 16 Feb 2020 16:33:22 +0100 Subject: 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 --- tests/auto/qdoc/generatedoutput/testcpp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') 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. -- cgit v1.2.1