summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodemarker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r--src/qdoc/cppcodemarker.cpp30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index 9846a0dd8..0b6b9ab07 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
@@ -26,10 +26,6 @@
**
****************************************************************************/
-/*
- cppcodemarker.cpp
-*/
-
#include "cppcodemarker.h"
#include "access.h"
@@ -213,7 +209,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const Node * /* relati
break;
case Node::TypeAlias:
if (style == Section::Details) {
- QString templateDecl = node->templateDecl();
+ const QString &templateDecl = node->templateDecl();
if (!templateDecl.isEmpty())
synopsis += templateDecl + QLatin1Char(' ');
}
@@ -257,17 +253,17 @@ QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary)
if (summary) {
name = linkTag(node, name);
} else if (node->isQmlProperty() || node->isJsProperty()) {
- const QmlPropertyNode *pn = static_cast<const QmlPropertyNode *>(node);
+ const auto *pn = static_cast<const QmlPropertyNode *>(node);
if (pn->isAttached())
name.prepend(pn->element() + QLatin1Char('.'));
}
name = "<@name>" + name + "</@name>";
QString synopsis;
if (node->isQmlProperty() || node->isJsProperty()) {
- const QmlPropertyNode *pn = static_cast<const QmlPropertyNode *>(node);
+ const auto *pn = static_cast<const QmlPropertyNode *>(node);
synopsis = name + " : " + typified(pn->dataType());
} else if (node->isFunction(Node::QML) || node->isFunction(Node::JS)) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ const auto *func = static_cast<const FunctionNode *>(node);
if (!func->returnType().isEmpty())
synopsis = typified(func->returnType(), true) + name;
else
@@ -320,22 +316,6 @@ QString CppCodeMarker::markedUpName(const Node *node)
return name;
}
-QString CppCodeMarker::markedUpFullName(const Node *node, const Node *relative)
-{
- if (node->name().isEmpty())
- return "global";
-
- QString fullName;
- for (;;) {
- fullName.prepend(markedUpName(node));
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend("<@op>::</@op>");
- node = node->parent();
- }
- return fullName;
-}
-
QString CppCodeMarker::markedUpEnumValue(const QString &enumValue, const Node *relative)
{
if (!relative->isEnumType())