diff options
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/qdoc/cppcodemarker.cpp | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index 40a3e8b81..cdaecebd9 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -163,7 +163,6 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const QString ¶mName = hasName ? (*p).name() : (*p).dataType(); if (style != Subpage || !hasName) synopsis += "<@param>" + protect(paramName) + "</@param>"; - synopsis += protect((*p).rightType()); if (style != Subpage && !(*p).defaultValue().isEmpty()) synopsis += " = " + protect((*p).defaultValue()); ++p; @@ -185,14 +184,24 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, synopsis.append(" = 0"); else if (func->isDeleted()) synopsis.append(" = delete"); - else if (func->isDefaulted()) + else if (func->isImplicit() || func->isDefaulted()) synopsis.append(" = default"); + if (func->isRef()) + synopsis.append(" &"); + else if (func->isRefRef()) + synopsis.append(" &&"); } else if (style == Subpage) { if (!func->returnType().isEmpty() && func->returnType() != "void") synopsis += " : " + typified(func->returnType()); } else { + if (func->isRef()) + synopsis.append(" &"); + else if (func->isRefRef()) + synopsis.append(" &&"); + if (func->isImplicit() || func->isDefaulted()) + synopsis.append(" = default"); QStringList bracketed; if (func->isStatic()) { bracketed += "static"; @@ -349,7 +358,6 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary) synopsis += typified((*p).dataType(), true); const QString ¶mName = hasName ? (*p).name() : (*p).dataType(); synopsis += "<@param>" + protect(paramName) + "</@param>"; - synopsis += protect((*p).rightType()); ++p; } } @@ -381,7 +389,7 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary) QString CppCodeMarker::markedUpName(const Node *node) { QString name = linkTag(node, taggedNode(node)); - if (node->type() == Node::Function) + if (node->isFunction() && !node->isMacro()) name += "()"; return name; } @@ -582,7 +590,7 @@ QList<Section> CppCodeMarker::sections(const Aggregate *inner, insert(publicFunctions, *c, style, status); } } - else { + else if ((*c)->type() != Node::SharedComment) { insert(publicTypes, *c, style, status); } break; @@ -666,7 +674,7 @@ QList<Section> CppCodeMarker::sections(const Aggregate *inner, NodeList::ConstIterator r = inner->relatedNodes().constBegin(); while (r != inner->relatedNodes().constEnd()) { - if ((*r)->type() == Node::Function) { + if ((*r)->isFunction()) { FunctionNode *func = static_cast<FunctionNode *>(*r); if (func->isMacro()) insert(macros, *r, style, status); @@ -681,21 +689,23 @@ QList<Section> CppCodeMarker::sections(const Aggregate *inner, NodeList::ConstIterator c = inner->childNodes().constBegin(); while (c != inner->childNodes().constEnd()) { - if ((*c)->type() == Node::Enum || - (*c)->type() == Node::Typedef) { + if ((*c)->isSharingComment()) { + // do nothing + } else if ((*c)->isEnumType() || (*c)->isTypedef()) { insert(memberTypes, *c, style, status); - } - else if ((*c)->type() == Node::Property) { + } else if ((*c)->isProperty()) { insert(properties, *c, style, status); - } - else if ((*c)->type() == Node::Variable) { + } else if ((*c)->isVariable()) { if (!(*c)->doc().isEmpty()) insert(memberVariables, *c, style, status); - } - else if ((*c)->type() == Node::Function) { + } else if ((*c)->isFunction()) { FunctionNode *function = static_cast<FunctionNode *>(*c); if (!function->hasAssociatedProperties() || !function->doc().isEmpty()) insert(memberFunctions, function, style, status); + } else if ((*c)->isSharedCommentNode()) { + SharedCommentNode *scn = static_cast<SharedCommentNode *>(*c); + if (!scn->doc().isEmpty()) + insert(memberFunctions, scn, style, status); } ++c; } @@ -918,7 +928,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, readChar(); - while (ch != EOF) { + while (ch != QChar(EOF)) { QString tag; bool target = false; @@ -977,7 +987,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, finish = i; readChar(); - while (ch != EOF && ch != '"') { + while (ch != QChar(EOF) && ch != '"') { if (ch == '\\') readChar(); readChar(); @@ -989,7 +999,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, case '#': finish = i; readChar(); - while (ch != EOF && ch != '\n') { + while (ch != QChar(EOF) && ch != '\n') { if (ch == '\\') readChar(); finish = i; @@ -1001,7 +1011,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, finish = i; readChar(); - while (ch != EOF && ch != '\'') { + while (ch != QChar(EOF) && ch != '\'') { if (ch == '\\') readChar(); readChar(); @@ -1036,7 +1046,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, do { finish = i; readChar(); - } while (ch != EOF && ch != '\n'); + } while (ch != QChar(EOF) && ch != '\n'); tag = QStringLiteral("comment"); } else if (ch == '*') { bool metAster = false; @@ -1046,7 +1056,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, readChar(); while (!metAsterSlash) { - if (ch == EOF) + if (ch == QChar(EOF)) break; if (ch == '*') |