diff options
author | Martin Smith <martin.smith@theqtcompany.com> | 2016-02-22 15:39:02 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@theqtcompany.com> | 2016-02-26 12:06:03 +0000 |
commit | 184c8f82a0b2e7ed8d307c796a5ba92b66723abe (patch) | |
tree | fbecd7a0baf44b2b0b3b9e29a7418870170a9910 /src/qdoc/generator.cpp | |
parent | 8237d6d1171d7d7d677eada7d49ab7b5d85b09e7 (diff) | |
download | qttools-184c8f82a0b2e7ed8d307c796a5ba92b66723abe.tar.gz |
qdoc: Avoid more unnecessary qdoc warnings
Now avoids qdoc warnings for undocumented copy-assignment
operators and move-assignment operators. This update also
improves the text output by surrounding it with <p> and </p>.
There was also a bit of refactoring.
Change-Id: I922c7083d17b9b911d81f818f51fe7623a78eb22
Task-number: QTBUG-50630
Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
Diffstat (limited to 'src/qdoc/generator.cpp')
-rw-r--r-- | src/qdoc/generator.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 460be6454..0765e8ab7 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -564,7 +564,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) { const FunctionNode *fn = static_cast<const FunctionNode *>(node); - if (fn->metaness() == FunctionNode::Dtor) + if (fn->isDtor()) anchorRef = "#dtor." + fn->name().mid(1); else if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty()) @@ -764,23 +764,45 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) text << func->parent()->name() << "."; if (func->isVirtual()) text << " The destructor is virtual."; + out() << "<p>"; generateText(text, node, marker); + out() << "</p>"; } else if (func->isCtor()) { Text text; text << "Default constructs an instance of "; text << func->parent()->name() << "."; + out() << "<p>"; generateText(text, node, marker); + out() << "</p>"; } else if (func->isCCtor()) { Text text; text << "Copy constructor."; + out() << "<p>"; generateText(text, node, marker); + out() << "</p>"; } else if (func->isMCtor()) { Text text; text << "Move-copy constructor."; + out() << "<p>"; generateText(text, node, marker); + out() << "</p>"; + } + else if (func->isCAssign()) { + Text text; + text << "Copy-assignment operator."; + out() << "<p>"; + generateText(text, node, marker); + out() << "</p>"; + } + else if (func->isMAssign()) { + Text text; + text << "Move-assignment operator."; + out() << "<p>"; + generateText(text, node, marker); + out() << "</p>"; } else if (!node->isWrapper() && !quiet && !node->isReimplemented()) { node->location().warning(tr("No documentation for '%1'").arg(node->plainSignature())); @@ -1518,7 +1540,7 @@ void Generator::generateOverloadedSignal(const Node* node, CodeMarker* marker) if (node->type() != Node::Function) return; const FunctionNode *func = static_cast<const FunctionNode *>(node); - if (func->metaness() != FunctionNode::Signal) + if (!func->isSignal()) return; if (node->parent()->overloads(node->name()).count() <= 1) return; |