summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-05-14 14:06:06 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-05-14 14:06:06 +0200
commit814f95db87f469abf8386825cf2db2ecc208c62b (patch)
tree3ba8bd58aa20e8fab166be6e3957dd98edbcc72d
parentef0ea4f2cfa3dbcf2f3347a661670b38eeea2106 (diff)
parent94e861104a1d689dfd12018e7be377699ab24917 (diff)
Merge remote-tracking branch 'origin/5.15.0' into 5.15
-rw-r--r--dist/changes-5.15.058
-rw-r--r--src/qdoc/clangcodeparser.cpp16
-rw-r--r--src/qdoc/cppcodemarker.cpp7
-rw-r--r--src/qdoc/cppcodeparser.cpp4
-rw-r--r--src/qdoc/doc/qdoc-manual-cmdindex.qdoc1
-rw-r--r--src/qdoc/doc/qdoc-manual-topiccmds.qdoc36
-rw-r--r--src/qdoc/docbookgenerator.cpp64
-rw-r--r--src/qdoc/docbookgenerator.h3
-rw-r--r--src/qdoc/generator.cpp41
-rw-r--r--src/qdoc/generator.h5
-rw-r--r--src/qdoc/helpprojectwriter.cpp3
-rw-r--r--src/qdoc/node.cpp4
-rw-r--r--src/qdoc/node.h20
-rw-r--r--src/qdoc/qdocindexfiles.cpp13
-rw-r--r--src/qdoc/qdoctagfiles.cpp2
-rw-r--r--src/qdoc/sections.cpp5
-rw-r--r--src/qdoc/sections.h1
-rw-r--r--src/qdoc/tree.cpp15
-rw-r--r--src/qdoc/tree.h2
-rw-r--r--src/qdoc/xmlgenerator.cpp6
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html3
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml13
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml25
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html13
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html13
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/test.qhp3
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testcpp.index3
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html13
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html6
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived.html22
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp15
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h5
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp2
37 files changed, 409 insertions, 54 deletions
diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0
new file mode 100644
index 000000000..b061a693f
--- /dev/null
+++ b/dist/changes-5.15.0
@@ -0,0 +1,58 @@
+Qt 5.15 introduces many new features and improvements as well as bugfixes
+over the 5.14.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* QtHelp *
+****************************************************************************
+
+ - QHelpLink data structure has been introduced and used in newly added
+ documentsForIdentifier() and documentsForKeyword() methods.
+ - Deprecated linksForIdentifier() and linksForKeyword() methods
+ in favor of the methods above.
+ - The QHelpFilterSettings class has been added, describing all
+ the available filter details.
+ - The QHelpFilterSettingsWidget class has been added, serving
+ as an editor for all available filters.
+
+****************************************************************************
+* Qt Designer *
+****************************************************************************
+
+ - The palette editor dialog has been overhauled.
+
+****************************************************************************
+* macdeployqt *
+****************************************************************************
+
+ - Added "-hardened-runtime" option to support app notarization.
+
+****************************************************************************
+* qdoc *
+****************************************************************************
+
+ - QDoc now supports DocBook as an output format.
+ - Introduced configuration variable 'locationinfo' to drop host-specific
+ paths from the generated output.
+ - Added capability to display class/method template parameters in the
+ generated documentation.
+ - QDoc now generates correct documentation for enum classes.
+ - QDoc is now aware of the namespace scope of an \fn command without
+ requiring fully qualified paths.
+ - Generate output for arguments passed to the \obsolete command.
+ - [QTBUG-37355] QDoc now generates a note for the name of the
+ corresponding handler in \qmlsignal documentation.
+ - Added support for CMake-based example projects.
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index b5c6a8ac6..0a0b7e7ac 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -632,18 +632,14 @@ CXChildVisitResult ClangVisitor::visitHeader(CXCursor cursor, CXSourceLocation l
QString templateString;
switch (kind) {
case CXCursor_TypeAliasDecl: {
- QString spelling = getSpelling(clang_getCursorExtent(cursor));
- QStringList typeAlias = spelling.split(QChar('='));
+ QString aliasDecl = getSpelling(clang_getCursorExtent(cursor)).simplified();
+ QStringList typeAlias = aliasDecl.split(QLatin1Char('='));
if (typeAlias.size() == 2) {
- typeAlias[0] = typeAlias[0].trimmed();
+ typeAlias[0] = typeAlias[0].trimmed().split(QLatin1Char(' ')).last();
typeAlias[1] = typeAlias[1].trimmed();
- int lastBlank = typeAlias[0].lastIndexOf(QChar(' '));
- if (lastBlank > 0) {
- typeAlias[0] = typeAlias[0].right(typeAlias[0].size() - (lastBlank + 1));
- TypeAliasNode *ta = new TypeAliasNode(parent_, typeAlias[0], typeAlias[1]);
- ta->setAccess(fromCX_CXXAccessSpecifier(clang_getCXXAccessSpecifier(cursor)));
- ta->setLocation(fromCXSourceLocation(clang_getCursorLocation(cursor)));
- }
+ TypeAliasNode *ta = new TypeAliasNode(parent_, typeAlias[0], typeAlias[1]);
+ ta->setAccess(fromCX_CXXAccessSpecifier(clang_getCXXAccessSpecifier(cursor)));
+ ta->setLocation(fromCXSourceLocation(clang_getCursorLocation(cursor)));
}
return CXChildVisit_Continue;
}
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index 38dd8e79f..79313e2dd 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -252,6 +252,13 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const Node * /* relati
synopsis += QLatin1Char('}');
}
break;
+ case Node::TypeAlias:
+ if (style == Section::Summary)
+ synopsis = "(alias) ";
+ else if (style == Section::Details)
+ extra = QStringLiteral("[alias] ");
+ synopsis += name;
+ break;
case Node::Typedef:
typedeff = static_cast<const TypedefNode *>(node);
if (typedeff->associatedEnum()) {
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 5248c990d..cccc1d86d 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -102,7 +102,7 @@ void CppCodeParser::initializeParser()
nodeTypeMap_.insert(COMMAND_STRUCT, Node::Struct);
nodeTypeMap_.insert(COMMAND_UNION, Node::Union);
nodeTypeMap_.insert(COMMAND_ENUM, Node::Enum);
- nodeTypeMap_.insert(COMMAND_TYPEALIAS, Node::Typedef);
+ nodeTypeMap_.insert(COMMAND_TYPEALIAS, Node::TypeAlias);
nodeTypeMap_.insert(COMMAND_TYPEDEF, Node::Typedef);
nodeTypeMap_.insert(COMMAND_PROPERTY, Node::Property);
nodeTypeMap_.insert(COMMAND_VARIABLE, Node::Variable);
@@ -112,7 +112,7 @@ void CppCodeParser::initializeParser()
nodeTypeTestFuncMap_.insert(COMMAND_STRUCT, &Node::isStruct);
nodeTypeTestFuncMap_.insert(COMMAND_UNION, &Node::isUnion);
nodeTypeTestFuncMap_.insert(COMMAND_ENUM, &Node::isEnumType);
- nodeTypeTestFuncMap_.insert(COMMAND_TYPEALIAS, &Node::isTypedef);
+ nodeTypeTestFuncMap_.insert(COMMAND_TYPEALIAS, &Node::isTypeAlias);
nodeTypeTestFuncMap_.insert(COMMAND_TYPEDEF, &Node::isTypedef);
nodeTypeTestFuncMap_.insert(COMMAND_PROPERTY, &Node::isProperty);
nodeTypeTestFuncMap_.insert(COMMAND_VARIABLE, &Node::isVariable);
diff --git a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc
index 430fdf0f8..5cd55c667 100644
--- a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc
+++ b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc
@@ -144,6 +144,7 @@
\li \l {threadsafe-command} {\\threadsafe}
\li \l {title-command} {\\title}
\li \l {tt-command} {\\tt}
+ \li \l {typealias-command} {\\typealias}
\li \l {typedef-command} {\\typedef}
\li \l {uicontrol-command} {\\uicontrol}
\li \l {underline-command} {\\underline}
diff --git a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc
index 8e142f5af..a537c7499 100644
--- a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc
+++ b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc
@@ -1410,6 +1410,40 @@
{\\instantiates} to specify that a Transform is instantiated by
the C++ class QGraphicsTransform. A \\qmltype comment should
+ \target typealias-command
+ \section1 \\typealias
+
+ The \\typealias command is similar to \l {typedef-command}{\\typedef},
+ but specific to documenting a C++ type alias:
+
+ \code
+ class Foo
+ {
+ public:
+ using ptr = void*;
+ // ...
+ }
+ \endcode
+
+ This can be documented as
+
+ \badcode *
+ /\1!
+ \typealias Foo::ptr
+ \1/
+ \endcode
+
+ QDoc will automatically generate a sentence in the documentation describing
+ the alias:
+
+ \quotation
+ This is a type alias for \c {void*}.
+ \endquotation
+
+ The \\typealias command was introduced in QDoc 5.15.
+
+ See also \l {typedef-command}{\\typedef}.
+
\target typedef-command
\section1 \\typedef
@@ -1498,6 +1532,8 @@
Qt-style synonym for QList::iterator.
\endquotation
+ See also \l {typealias-command}{\\typealias}.
+
\target variable-command
\section1 \\variable
diff --git a/src/qdoc/docbookgenerator.cpp b/src/qdoc/docbookgenerator.cpp
index e463a6b45..7e671e7d0 100644
--- a/src/qdoc/docbookgenerator.cpp
+++ b/src/qdoc/docbookgenerator.cpp
@@ -2105,10 +2105,11 @@ void DocBookGenerator::generateBody(const Node *node)
writer->writeTextElement(dbNamespace, "para", t);
}
} else if (!node->isSharingComment()) {
- if (fn) {
- if (!fn->overridesThis().isEmpty())
- generateReimplementsClause(fn);
- }
+ // Reimplements clause and type alias info precede body text
+ if (fn && !fn->overridesThis().isEmpty())
+ generateReimplementsClause(fn);
+ else if (node->isTypeAlias())
+ generateAddendum(node, TypeAlias, nullptr, false);
if (!generateText(node->doc().body(), node)) {
if (node->isMarkedReimp())
@@ -2726,6 +2727,8 @@ void DocBookGenerator::generateDocBookSynopsis(const Node *node)
else if (functionNode->isDefault())
signature += " = default";
generateSynopsisInfo("signature", signature);
+ } else if (node->isTypedef()) {
+ writer->writeTextElement(dbNamespace, "type", node->plainName());
} else {
node->doc().location().warning(tr("Unexpected node type in generateDocBookSynopsis: %1")
.arg(node->nodeTypeString()));
@@ -3157,10 +3160,10 @@ void DocBookGenerator::generateSynopsis(const Node *node, const Node *relative,
// First generate the extra part if needed (condition from HtmlGenerator::generateSynopsis).
if (generateExtra) {
- if (node->nodeType() == Node::Function) {
- const auto func = static_cast<const FunctionNode *>(node);
- if (style != Section::Summary && style != Section::Accessors) {
- QStringList bracketed;
+ if (style != Section::Summary && style != Section::Accessors) {
+ QStringList bracketed;
+ if (node->isFunction()) {
+ const auto func = static_cast<const FunctionNode *>(node);
if (func->isStatic()) {
bracketed += "static";
} else if (!func->isNonvirtual()) {
@@ -3182,11 +3185,12 @@ void DocBookGenerator::generateSynopsis(const Node *node, const Node *relative,
bracketed += "signal";
else if (func->isSlot())
bracketed += "slot";
-
- if (!bracketed.isEmpty())
- writer->writeCharacters(QLatin1Char('[') + bracketed.join(' ')
- + QStringLiteral("] "));
+ } else if (node->isTypeAlias()) {
+ bracketed += "alias";
}
+ if (!bracketed.isEmpty())
+ writer->writeCharacters(QLatin1Char('[') + bracketed.join(' ')
+ + QStringLiteral("] "));
}
if (style == Section::Summary) {
@@ -3197,6 +3201,8 @@ void DocBookGenerator::generateSynopsis(const Node *node, const Node *relative,
extra = "(deprecated) ";
else if (node->isObsolete())
extra = "(obsolete) ";
+ else if (node->isTypeAlias())
+ extra = "(alias) ";
if (!extra.isEmpty())
writer->writeCharacters(extra);
@@ -3407,12 +3413,15 @@ void DocBookGenerator::generateOverloadedSignal(const Node *node)
Generates an addendum note of type \a type for \a node. \a marker
is unused in this generator.
*/
-void DocBookGenerator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker)
+void DocBookGenerator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker,
+ bool generateNote)
{
Q_UNUSED(marker);
Q_ASSERT(node && !node->name().isEmpty());
- writer->writeStartElement(dbNamespace, "note");
- newLine();
+ if (generateNote) {
+ writer->writeStartElement(dbNamespace, "note");
+ newLine();
+ }
switch (type) {
case Invokable:
writer->writeStartElement(dbNamespace, "para");
@@ -3475,12 +3484,33 @@ void DocBookGenerator::generateAddendum(const Node *node, Addendum type, CodeMar
}
break;
}
+ case TypeAlias:
+ {
+ if (!node->isTypeAlias())
+ return;
+ writer->writeStartElement(dbNamespace, "para");
+ const auto *ta = static_cast<const TypeAliasNode *>(node);
+ writer->writeCharacters("This is a type alias for ");
+ if (ta->aliasedNode() && ta->aliasedNode()->isInAPI())
+ generateSimpleLink(linkForNode(ta->aliasedNode(), nullptr),
+ ta->aliasedNode()->plainFullName(ta->parent()));
+ else
+ writer->writeTextElement(dbNamespace, "code", ta->aliasedType());
+
+ writer->writeCharacters(".");
+ writer->writeEndElement(); // para
+ newLine();
+ break;
+ }
+
default:
break;
}
- writer->writeEndElement(); // note
- newLine();
+ if (generateNote) {
+ writer->writeEndElement(); // note
+ newLine();
+ }
}
void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode *relative)
diff --git a/src/qdoc/docbookgenerator.h b/src/qdoc/docbookgenerator.h
index 5eea595f7..753f5be33 100644
--- a/src/qdoc/docbookgenerator.h
+++ b/src/qdoc/docbookgenerator.h
@@ -81,7 +81,8 @@ protected:
bool generateStatus(const Node *node);
bool generateThreadSafeness(const Node *node);
bool generateSince(const Node *node);
- void generateAddendum(const Node *node, Generator::Addendum type, CodeMarker *marker = nullptr) override;
+ void generateAddendum(const Node *node, Generator::Addendum type, CodeMarker *marker = nullptr,
+ bool generateNote = true) override;
using Generator::generateBody;
void generateBody(const Node *node);
diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp
index bdeeec2be..b3aacb623 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -644,6 +644,9 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
case Node::Enum:
anchorRef = QLatin1Char('#') + node->name() + "-enum";
break;
+ case Node::TypeAlias:
+ anchorRef = QLatin1Char('#') + node->name() + "-alias";
+ break;
case Node::Typedef: {
const TypedefNode *tdef = static_cast<const TypedefNode *>(node);
if (tdef->associatedEnum()) {
@@ -818,10 +821,11 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
tr("No documentation for '%1'").arg(node->plainSignature()));
}
} else if (!node->isSharingComment()) {
- if (fn) {
- if (!fn->overridesThis().isEmpty())
- generateReimplementsClause(fn, marker);
- }
+ // Reimplements clause and type alias info precede body text
+ if (fn && !fn->overridesThis().isEmpty())
+ generateReimplementsClause(fn, marker);
+ else if (node->isTypeAlias())
+ generateAddendum(node, TypeAlias, marker, false);
if (!generateText(node->doc().body(), node, marker)) {
if (node->isMarkedReimp())
@@ -1357,12 +1361,17 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
Generates an addendum note of type \a type for \a node, using \a marker
as the code marker.
*/
-void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker)
+void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker,
+ bool generateNote)
{
Q_ASSERT(node && !node->name().isEmpty());
Text text;
- text << Atom::ParaLeft << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
- << "Note: " << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
+ text << Atom::ParaLeft;
+
+ if (generateNote) {
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
+ << "Note: " << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
+ }
switch (type) {
case Invokable:
@@ -1419,6 +1428,22 @@ void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *ma
}
break;
}
+ case TypeAlias:
+ {
+ if (!node->isTypeAlias())
+ return;
+ const auto *ta = static_cast<const TypeAliasNode *>(node);
+ text << "This is a type alias for ";
+ if (ta->aliasedNode() && ta->aliasedNode()->isInAPI()) {
+ text << Atom(Atom::LinkNode, CodeMarker::stringForNode(ta->aliasedNode()))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, ta->aliasedNode()->plainFullName(ta->parent()))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK) << ".";
+ } else {
+ text << Atom(Atom::String, ta->aliasedType()) << ".";
+ }
+ break;
+ }
default:
return;
}
@@ -2195,6 +2220,8 @@ QString Generator::typeString(const Node *node)
return "enum";
case Node::Typedef:
return "typedef";
+ case Node::TypeAlias:
+ return "alias";
case Node::Function: {
const auto fn = static_cast<const FunctionNode *>(node);
switch (fn->metaness()) {
diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h
index dca915ba7..8a613224f 100644
--- a/src/qdoc/generator.h
+++ b/src/qdoc/generator.h
@@ -53,7 +53,7 @@ class Generator
public:
enum ListType { Generic, Obsolete };
- enum Addendum { Invokable, PrivateSignal, QmlSignalHandler, AssociatedProperties };
+ enum Addendum { Invokable, PrivateSignal, QmlSignalHandler, AssociatedProperties, TypeAlias };
Generator();
virtual ~Generator();
@@ -141,7 +141,8 @@ protected:
static QString formatSince(const Node *node);
void generateSince(const Node *node, CodeMarker *marker);
void generateStatus(const Node *node, CodeMarker *marker);
- virtual void generateAddendum(const Node *node, Addendum type, CodeMarker *marker);
+ virtual void generateAddendum(const Node *node, Addendum type, CodeMarker *marker,
+ bool generateNote = true);
void generateThreadSafeness(const Node *node, CodeMarker *marker);
QString getMetadataElement(const Aggregate *inner, const QString &t);
QStringList getMetadataElements(const Aggregate *inner, const QString &t);
diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp
index a372ea762..d411802dc 100644
--- a/src/qdoc/helpprojectwriter.cpp
+++ b/src/qdoc/helpprojectwriter.cpp
@@ -137,6 +137,7 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
typeHash["example"] = Node::Example;
typeHash["externalpage"] = Node::ExternalPage;
typeHash["typedef"] = Node::Typedef;
+ typeHash["typealias"] = Node::TypeAlias;
typeHash["function"] = Node::Function;
typeHash["property"] = Node::Property;
typeHash["variable"] = Node::Variable;
@@ -389,7 +390,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QXmlStreamWriter &
if (node->parent())
project.memberStatus[node->parent()].insert(node->status());
} break;
-
+ case Node::TypeAlias:
case Node::Typedef: {
const TypedefNode *typedefNode = static_cast<const TypedefNode *>(node);
QStringList typedefDetails = keywordDetails(node);
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index 634cce3ec..cf8fa00f5 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -94,7 +94,7 @@ void Node::initialize()
goals_.insert("example", Node::Example);
goals_.insert("externalpage", Node::ExternalPage);
goals_.insert("typedef", Node::Typedef);
- goals_.insert("typealias", Node::Typedef);
+ goals_.insert("typealias", Node::TypeAlias);
goals_.insert("function", Node::Function);
goals_.insert("proxy", Node::Proxy);
goals_.insert("property", Node::Property);
@@ -938,6 +938,8 @@ QString Node::nodeTypeString(NodeType t)
return QLatin1String("example");
case ExternalPage:
return QLatin1String("external page");
+ case TypeAlias:
+ return QLatin1String("alias");
case Typedef:
return QLatin1String("typedef");
case Function:
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index b7293f408..4ec01673f 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -86,6 +86,7 @@ public:
ExternalPage,
Function,
Typedef,
+ TypeAlias,
Property,
Variable,
Group,
@@ -198,8 +199,8 @@ public:
bool isRelatedNonmember() const { return relatedNonmember_; }
bool isStruct() const { return nodeType_ == Struct; }
bool isSharedCommentNode() const { return nodeType_ == SharedComment; }
- bool isTypeAlias() const { return nodeType_ == Typedef; }
- bool isTypedef() const { return nodeType_ == Typedef; }
+ bool isTypeAlias() const { return nodeType_ == TypeAlias; }
+ bool isTypedef() const { return nodeType_ == Typedef || nodeType_ == TypeAlias; }
bool isUnion() const { return nodeType_ == Union; }
bool isVariable() const { return nodeType_ == Variable; }
bool isGenericCollection() const { return (nodeType_ == Node::Collection); }
@@ -892,8 +893,8 @@ private:
class TypedefNode : public Node
{
public:
- TypedefNode(Aggregate *parent, const QString &name)
- : Node(Typedef, parent, name), associatedEnum_(nullptr)
+ TypedefNode(Aggregate *parent, const QString &name, NodeType type = Typedef)
+ : Node(type, parent, name), associatedEnum_(nullptr)
{
}
@@ -912,16 +913,21 @@ private:
class TypeAliasNode : public TypedefNode
{
public:
- TypeAliasNode(Aggregate *parent, const QString &name, const QString &aliasedType)
- : TypedefNode(parent, name), aliasedType_(aliasedType)
+ TypeAliasNode(Aggregate *parent,
+ const QString &name,
+ const QString &aliasedType)
+ : TypedefNode(parent, name, NodeType::TypeAlias), aliasedType_(aliasedType)
{
}
- QString aliasedType() { return aliasedType_; }
+ const QString &aliasedType() const { return aliasedType_; }
+ const Node *aliasedNode() const { return aliasedNode_; }
+ void setAliasedNode(const Node *node) { aliasedNode_ = node; }
Node *clone(Aggregate *parent) override;
private:
QString aliasedType_;
+ const Node *aliasedNode_ {};
};
inline void EnumNode::setFlagsType(TypedefNode *t)
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index 60cace3c9..d2768803d 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -454,6 +454,13 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader &reader, Node *current,
else if (!indexUrl.isNull())
location = Location(parent->name().toLower() + ".html");
+ } else if (elementName == QLatin1String("alias")) {
+ node = new TypeAliasNode(parent, name, attributes.value(QLatin1String("aliasedtype")).toString());
+ if (!indexUrl.isEmpty())
+ location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
+ else if (!indexUrl.isNull())
+ location = Location(parent->name().toLower() + ".html");
+
} else if (elementName == QLatin1String("property")) {
node = new PropertyNode(parent, name);
@@ -864,6 +871,9 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter &writer, Node *node,
case Node::Typedef:
nodeName = "typedef";
break;
+ case Node::TypeAlias:
+ nodeName = "alias";
+ break;
case Node::Property:
nodeName = "property";
break;
@@ -1196,6 +1206,9 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter &writer, Node *node,
if (typedefNode->associatedEnum())
writer.writeAttribute("enum", typedefNode->associatedEnum()->fullDocumentName());
} break;
+ case Node::TypeAlias:
+ writer.writeAttribute("aliasedtype", static_cast<const TypeAliasNode *>(node)->aliasedType());
+ break;
case Node::Function: // Now processed in generateFunctionSection()
default:
break;
diff --git a/src/qdoc/qdoctagfiles.cpp b/src/qdoc/qdoctagfiles.cpp
index 0d9b0aee0..2d9bce006 100644
--- a/src/qdoc/qdoctagfiles.cpp
+++ b/src/qdoc/qdoctagfiles.cpp
@@ -183,6 +183,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter &writer, const Aggreg
nodeName = "member";
kind = "enumeration";
break;
+ case Node::TypeAlias: // Treated as typedef
case Node::Typedef:
nodeName = "member";
kind = "typedef";
@@ -309,6 +310,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter &writer, const Aggreg
writer.writeEndElement(); // member
}
} break;
+ case Node::TypeAlias: // Treated as typedef
case Node::Typedef: {
const TypedefNode *typedefNode = static_cast<const TypedefNode *>(node);
if (typedefNode->associatedEnum())
diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp
index c9012e21c..00357c246 100644
--- a/src/qdoc/sections.cpp
+++ b/src/qdoc/sections.cpp
@@ -373,6 +373,9 @@ Sections::Sections(const NodeMultiMap &nsmap) : aggregate_(nullptr)
case Node::Typedef:
sections[SinceTypedefs].appendMember(node);
break;
+ case Node::TypeAlias:
+ sections[SinceTypeAliases].appendMember(node);
+ break;
case Node::Function: {
const FunctionNode *fn = static_cast<const FunctionNode *>(node);
switch (fn->metaness()) {
@@ -552,6 +555,7 @@ void Sections::initSections()
v[SinceMacros].init(" New Macros");
v[SinceEnumTypes].init(" New Enum Types");
v[SinceTypedefs].init(" New Typedefs");
+ v[SinceTypeAliases].init(" New Type Aliases");
v[SinceProperties].init(" New Properties");
v[SinceVariables].init(" New Variables");
v[SinceQmlTypes].init(" New QML Types");
@@ -623,6 +627,7 @@ void Sections::stdRefPageSwitch(SectionVector &v, Node *n, Node *t)
return;
case Node::Enum:
case Node::Typedef:
+ case Node::TypeAlias:
v[StdTypes].insert(n);
return;
case Node::Function: {
diff --git a/src/qdoc/sections.h b/src/qdoc/sections.h
index c8d17b141..dfcaaed7b 100644
--- a/src/qdoc/sections.h
+++ b/src/qdoc/sections.h
@@ -180,6 +180,7 @@ public:
QmlAttachedMethods = 6,
ProtectedTypes = 7,
SinceTypedefs = 7,
+ SinceTypeAliases = 7,
ProtectedFunctions = 8,
SinceProperties = 8,
ProtectedSlots = 9,
diff --git a/src/qdoc/tree.cpp b/src/qdoc/tree.cpp
index f6477b6b1..e20b8cc65 100644
--- a/src/qdoc/tree.cpp
+++ b/src/qdoc/tree.cpp
@@ -355,11 +355,14 @@ void Tree::resolveCppToQmlLinks()
/*!
For each C++ class node, resolve any \c using clauses
that appeared in the class declaration.
+
+ For type aliases, resolve the aliased node.
*/
-void Tree::resolveUsingClauses()
+void Tree::resolveUsingClauses(Aggregate *parent)
{
- const NodeList &children = root_.childNodes();
- for (auto *child : children) {
+ if (!parent)
+ parent = &root_;
+ for (auto *child : parent->childNodes()) {
if (child->isClassNode()) {
ClassNode *cn = static_cast<ClassNode *>(child);
QVector<UsingClause> &usingClauses = cn->usingClauses();
@@ -370,7 +373,13 @@ void Tree::resolveUsingClauses()
usingClause.setNode(n);
}
}
+ } else if (child->isTypeAlias()) {
+ TypeAliasNode *ta = static_cast<TypeAliasNode *>(child);
+ ta->setAliasedNode(qdb_->findNodeForTarget(ta->aliasedType(), child->parent()));
}
+
+ if (child->genus() == Node::CPP && child->isAggregate())
+ resolveUsingClauses(static_cast<Aggregate *>(child));
}
}
diff --git a/src/qdoc/tree.h b/src/qdoc/tree.h
index b7e4dce75..10272ec84 100644
--- a/src/qdoc/tree.h
+++ b/src/qdoc/tree.h
@@ -151,7 +151,7 @@ private: // The rest of the class is private.
void resolvePropertyOverriddenFromPtrs(Aggregate *n);
void resolveProperties();
void resolveCppToQmlLinks();
- void resolveUsingClauses();
+ void resolveUsingClauses(Aggregate *parent = nullptr);
void removePrivateAndInternalBases(NamespaceNode *rootNode);
NamespaceNode *root() { return &root_; }
const NamespaceNode *root() const { return &root_; }
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp
index 8b266ca18..ffffc283a 100644
--- a/src/qdoc/xmlgenerator.cpp
+++ b/src/qdoc/xmlgenerator.cpp
@@ -76,6 +76,7 @@ int XmlGenerator::hOffset(const Node *node)
case Node::Page:
return 1;
case Node::Enum:
+ case Node::TypeAlias:
case Node::Typedef:
case Node::Function:
case Node::Property:
@@ -239,6 +240,9 @@ QString XmlGenerator::refForNode(const Node *node)
case Node::Enum:
ref = node->name() + "-enum";
break;
+ case Node::TypeAlias:
+ ref = node->name() + "-alias";
+ break;
case Node::Typedef: {
const auto tdn = static_cast<const TypedefNode *>(node);
if (tdn->associatedEnum())
@@ -450,6 +454,8 @@ QString XmlGenerator::targetType(const Node *node)
return QStringLiteral("page");
case Node::Enum:
return QStringLiteral("enum");
+ case Node::TypeAlias:
+ return QStringLiteral("alias");
case Node::Typedef:
return QStringLiteral("typedef");
case Node::Property:
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
index 21870bb3f..1b7260e33 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
@@ -11,6 +11,9 @@
<h1 class="title">List of All Members for TestType</h1>
<p>This is the complete list of members for <a href="testtype.html">TestType</a>, including inherited members.</p>
<ul>
+<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#DerivedType-alias">DerivedType</a></b></span></li>
+<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#NotTypedef-alias">NotTypedef</a></b></span></li>
+<li class="fn">typedef <span class="name"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></span></li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testtype.html#nothing">nothing</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
index 76025b06e..768e4d8f1 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
@@ -32,6 +32,19 @@
<db:section xml:id="details">
<db:title>Detailed Description</db:title>
</db:section>
+<db:section xml:id="member-type-documentation">
+<db:title>Member Type Documentation</db:title>
+<db:section xml:id="SomeType-typedef">
+<db:title>Test::typedef SomeType</db:title>
+<db:typedefsynopsis>
+<db:type>SomeType</db:type><db:synopsisinfo db:role="access">public</db:synopsisinfo>
+<db:synopsisinfo db:role="status">active</db:synopsisinfo>
+<db:synopsisinfo db:role="threadsafeness">unspecified</db:synopsisinfo>
+<db:synopsisinfo db:role="module">TestCPP</db:synopsisinfo>
+</db:typedefsynopsis>
+<db:para>A typedef.</db:para>
+</db:section>
+</db:section>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
<db:section xml:id="overload">
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml
index 9bb613cfc..ced1bea5b 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml
@@ -32,6 +32,31 @@
<db:section xml:id="details">
<db:title>Detailed Description</db:title>
</db:section>
+<db:section xml:id="member-type-documentation">
+<db:title>Member Type Documentation</db:title>
+<db:section xml:id="DerivedType-alias">
+<db:title>[alias] TestDerived::DerivedType</db:title>
+<db:typedefsynopsis>
+<db:type>DerivedType</db:type><db:synopsisinfo db:role="access">public</db:synopsisinfo>
+<db:synopsisinfo db:role="status">active</db:synopsisinfo>
+<db:synopsisinfo db:role="threadsafeness">unspecified</db:synopsisinfo>
+<db:synopsisinfo db:role="module">TestCPP</db:synopsisinfo>
+</db:typedefsynopsis>
+<db:para>This is a type alias for <db:link xlink:href="testqdoc-test.xml#SomeType-typedef">TestQDoc::Test::SomeType</db:link>.</db:para>
+<db:para>An aliased typedef.</db:para>
+</db:section>
+<db:section xml:id="NotTypedef-alias">
+<db:title>[alias] TestDerived::NotTypedef</db:title>
+<db:typedefsynopsis>
+<db:type>NotTypedef</db:type><db:synopsisinfo db:role="access">public</db:synopsisinfo>
+<db:synopsisinfo db:role="status">active</db:synopsisinfo>
+<db:synopsisinfo db:role="threadsafeness">unspecified</db:synopsisinfo>
+<db:synopsisinfo db:role="module">TestCPP</db:synopsisinfo>
+</db:typedefsynopsis>
+<db:para>This is a type alias for <db:code>int</db:code>.</db:para>
+<db:para>I'm an alias, not a typedef.</db:para>
+</db:section>
+</db:section>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
<db:section xml:id="virtualFun">
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
index 7ae77ec5a..d7ee1f834 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
@@ -56,6 +56,11 @@
<para>Function that must be reimplemented.</para>
</description>
</function>
+ <typedef name="SomeType" fullname="TestQDoc::Test::SomeType" href="testqdoc-test.html#SomeType-typedef" status="active" access="public" location="testcpp.h" documented="true">
+ <description>
+ <brief>A typedef.</brief>
+ </description>
+ </typedef>
</class>
</document>
</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml
index 76a335658..7711b09df 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml
@@ -8,6 +8,16 @@
<function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override">
<description/>
</function>
+ <alias name="DerivedType" fullname="TestQDoc::TestDerived::DerivedType" href="testqdoc-testderived.html#DerivedType-alias" status="active" access="public" location="testcpp.h" documented="true" aliasedtype="Test::SomeType">
+ <description>
+ <para>An aliased typedef.</para>
+ </description>
+ </alias>
+ <alias name="NotTypedef" fullname="TestQDoc::TestDerived::NotTypedef" href="testqdoc-testderived.html#NotTypedef-alias" status="active" access="public" location="testcpp.h" documented="true" aliasedtype="int">
+ <description>
+ <para>I'm an alias, not a typedef.</para>
+ </description>
+ </alias>
</class>
</document>
</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html
index 0d4283a8f..7165b2bdb 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html
@@ -11,6 +11,7 @@
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
+<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
@@ -30,6 +31,11 @@
<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li>
<li><a href="testqdoc-test-obsolete.html">Obsolete members</a></li>
</ul>
+<a name="public-types"></a>
+<h2 id="public-types">Public Types</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></td></tr>
+</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
@@ -55,6 +61,13 @@
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@Test -->
+<div class="types">
+<h2>Member Type Documentation</h2>
+<!-- $$$SomeType -->
+<h3 class="fn" id="SomeType-typedef"><a name="SomeType-typedef"></a>typedef Test::<span class="name">SomeType</span></h3>
+<p>A typedef.</p>
+<!-- @@@SomeType -->
+</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$ -->
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html
index 864205274..1fc1a19d9 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html
@@ -35,6 +35,7 @@
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum class </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#ScopedEnum-enum">ScopedEnum</a></b> { This, That, All }</td></tr>
+<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
@@ -71,6 +72,10 @@
<tr><td class="topAlign"><code>TestQDoc::Test::ScopedEnum::All</code></td><td class="topAlign tblval"><code>This | That</code></td><td class="topAlign">Everything</td></tr>
</table></div>
<!-- @@@ScopedEnum -->
+<!-- $$$SomeType -->
+<h3 class="fn" id="SomeType-typedef"><a name="SomeType-typedef"></a>typedef Test::<span class="name">SomeType</span></h3>
+<p>A typedef.</p>
+<!-- @@@SomeType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html
index 75643dede..0ec969042 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html
@@ -11,6 +11,7 @@
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
+<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
@@ -30,6 +31,11 @@
<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li>
<li><a href="testqdoc-test-obsolete.html">Obsolete members</a></li>
</ul>
+<a name="public-types"></a>
+<h2 id="public-types">Public Types</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></td></tr>
+</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
@@ -56,6 +62,13 @@
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@Test -->
+<div class="types">
+<h2>Member Type Documentation</h2>
+<!-- $$$SomeType -->
+<h3 class="fn" id="SomeType-typedef"><a name="SomeType-typedef"></a>typedef Test::<span class="name">SomeType</span></h3>
+<p>A typedef.</p>
+<!-- @@@SomeType -->
+</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$ -->
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
index 2ec5e8159..3f3a78968 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
+++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
@@ -61,7 +61,10 @@
<keyword name="Switch" id="QML.Switch" ref="qml-uicomponents-switch.html"/>
<keyword name="TabWidget" id="QML.TabWidget" ref="qml-uicomponents-tabwidget.html"/>
<keyword name="Test" id="TestQDoc::Test" ref="testqdoc-test.html"/>
+ <keyword name="Test::SomeType" id="Test::SomeType" ref="testqdoc-test.html#SomeType-typedef"/>
<keyword name="TestDerived" id="TestQDoc::TestDerived" ref="testqdoc-testderived.html"/>
+ <keyword name="TestDerived::DerivedType" id="TestDerived::DerivedType" ref="testqdoc-testderived.html#DerivedType-alias"/>
+ <keyword name="TestDerived::NotTypedef" id="TestDerived::NotTypedef" ref="testqdoc-testderived.html#NotTypedef-alias"/>
<keyword name="TestQDoc" id="TestQDoc" ref="testqdoc.html"/>
<keyword name="Type" id="QML.Type" ref="qml-qdoc-test-type.html"/>
<keyword name="UI Components" id="UI Components" ref="uicomponents-qmlmodule.html"/>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
index ae3b4a875..3c0a54885 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
@@ -29,9 +29,12 @@
<parameter type="bool" name="b" default="false"/>
</function>
<function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()"/>
+ <typedef name="SomeType" fullname="TestQDoc::Test::SomeType" href="testqdoc-test.html#SomeType-typedef" status="active" access="public" location="testcpp.h" documented="true"/>
</class>
<class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace">
<function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"/>
+ <alias name="DerivedType" fullname="TestQDoc::TestDerived::DerivedType" href="testqdoc-testderived.html#DerivedType-alias" status="active" access="public" location="testcpp.h" documented="true" aliasedtype="Test::SomeType"/>
+ <alias name="NotTypedef" fullname="TestQDoc::TestDerived::NotTypedef" href="testqdoc-testderived.html#NotTypedef-alias" status="active" access="public" location="testcpp.h" documented="true" aliasedtype="int"/>
</class>
</namespace>
<module name="TestCPP" href="testcpp-module.html" status="active" documented="true" seen="true" title="QDoc Test C++ Classes" module="TestCPP" members="TestQDoc,Test,TestDerived" brief="A test module page"/>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html
index 5554519af..fc87f8613 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html
@@ -11,6 +11,7 @@
<h1 class="title">List of All Members for Test</h1>
<p>This is the complete list of members for <a href="testqdoc-test.html">TestQDoc::Test</a>, including inherited members.</p>
<ul>
+<li class="fn">typedef <span class="name"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></span></li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool )</li>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html
index 49066d0e6..805dc32a9 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html
@@ -11,6 +11,7 @@
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
+<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
@@ -30,6 +31,11 @@
<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li>
<li><a href="testqdoc-test-obsolete.html">Obsolete members</a></li>
</ul>
+<a name="public-types"></a>
+<h2 id="public-types">Public Types</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></td></tr>
+</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
@@ -55,6 +61,13 @@
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@Test -->
+<div class="types">
+<h2>Member Type Documentation</h2>
+<!-- $$$SomeType -->
+<h3 class="fn" id="SomeType-typedef"><a name="SomeType-typedef"></a>typedef Test::<span class="name">SomeType</span></h3>
+<p>A typedef.</p>
+<!-- @@@SomeType -->
+</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$ -->
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
index 89b206b27..4dc3649db 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
@@ -11,8 +11,12 @@
<h1 class="title">List of All Members for TestDerived</h1>
<p>This is the complete list of members for <a href="testqdoc-testderived.html">TestQDoc::TestDerived</a>, including inherited members.</p>
<ul>
-<li class="fn"><span class="name"><b><a href="testqdoc-test.html#QDOCTEST_MACRO2">QDOCTEST_MACRO2</a></b></span>()</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#DerivedType-alias">DerivedType</a></b></span></li>
+<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#NotTypedef-alias">NotTypedef</a></b></span></li>
+<li class="fn">typedef <span class="name"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></span></li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool )</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int ) : int</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b></span>(int , bool )</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#virtualFun">virtualFun</a></b></span>()</li>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived.html
index cafca0a8c..d3bd69b50 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived.html
@@ -11,13 +11,14 @@
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
+<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">TestDerived Class</h1>
-<span class="small-subtitle">(<a href="testqdoc-testderived.html">TestQDoc::TestDerived</a>)<br/></span>
+<span class="small-subtitle">class <a href="testqdoc.html">TestQDoc</a>::TestDerived</span>
<!-- $$$TestDerived-brief -->
<p>A derived class in a namespace. <a href="#details">More...</a></p>
<!-- @@@TestDerived -->
@@ -26,6 +27,12 @@
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += testcpp</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="testqdoc-test.html">TestQDoc::Test</a></td></tr></table></div><ul>
<li><a href="testqdoc-testderived-members.html">List of all members, including inherited members</a></li>
</ul>
+<a name="public-types"></a>
+<h2 id="public-types">Public Types</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> (alias) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-testderived.html#DerivedType-alias">DerivedType</a></b></td></tr>
+<tr><td class="memItemLeft rightAlign topAlign"> (alias) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-testderived.html#NotTypedef-alias">NotTypedef</a></b></td></tr>
+</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
@@ -37,6 +44,19 @@
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@TestDerived -->
+<div class="types">
+<h2>Member Type Documentation</h2>
+<!-- $$$DerivedType -->
+<h3 class="fn" id="DerivedType-alias"><a name="DerivedType-alias"></a><code>[alias] </code>TestDerived::<span class="name">DerivedType</span></h3>
+<p>This is a type alias for <a href="testqdoc-test.html#SomeType-typedef">TestQDoc::Test::SomeType</a>.</p>
+<p>An aliased typedef.</p>
+<!-- @@@DerivedType -->
+<!-- $$$NotTypedef -->
+<h3 class="fn" id="NotTypedef-alias"><a name="NotTypedef-alias"></a><code>[alias] </code>TestDerived::<span class="name">NotTypedef</span></h3>
+<p>This is a type alias for int.</p>
+<p>I'm an alias, not a typedef.</p>
+<!-- @@@NotTypedef -->
+</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$virtualFun[overload1]$$$virtualFun -->
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
index 31b910fae..e43ecf0b7 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
@@ -155,6 +155,11 @@ void Test::virtualFun()
}
/*!
+ \typedef Test::SomeType
+ \brief A typedef.
+*/
+
+/*!
\reimp
*/
void TestDerived::virtualFun()
@@ -173,6 +178,16 @@ void TestDerived::virtualFun()
*/
/*!
+ \typealias TestDerived::DerivedType
+ An aliased typedef.
+*/
+
+/*!
+ \typedef TestDerived::NotTypedef
+ I'm an alias, not a typedef.
+*/
+
+/*!
\if defined(test_template)
\fn template <typename T1, typename T2> void TestQDoc::Test::funcTemplate(T1 a, T2 b)
\brief Function template with two parameters, \a a and \a b.
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
index cb812375b..b9644eb94 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
@@ -41,6 +41,9 @@ public:
OmittedValue = 99
};
#endif
+ typedef struct {
+ int data;
+ } SomeType;
int someFunction(int v = 0);
void someFunctionDefaultArg(int i, bool b);
void obsoleteMember();
@@ -61,6 +64,8 @@ protected:
class TestDerived : public Test {
public:
+ using DerivedType = Test::SomeType;
+ using NotTypedef = int;
void virtualFun() override;
};
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index f8abee1b4..7cc0e67ab 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -217,6 +217,8 @@ void tst_generatedOutput::htmlFromCpp()
"testcpp-module.html "
"testqdoc-test.html "
"testqdoc-test-members.html "
+ "testqdoc-testderived.html "
+ "testqdoc-testderived-members.html "
"testqdoc.html");
}