diff options
Diffstat (limited to 'src/tools/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/tools/qdoc/cppcodemarker.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index 3851ede16c..400c4808ed 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -135,7 +135,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, name = "<@name>" + name + "</@name>"; if ((style == Detailed) && !node->parent()->name().isEmpty() && - (node->type() != Node::Property) && !node->isQmlNode()) + (node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode()) name.prepend(taggedNode(node->parent()) + "::"); switch (node->type()) { @@ -307,14 +307,14 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary) QString name = taggedQmlNode(node); if (summary) name = linkTag(node,name); - else if (node->type() == Node::QmlProperty) { + else if (node->isQmlProperty() || node->isJsProperty()) { const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node); if (pn->isAttached()) name.prepend(pn->element() + QLatin1Char('.')); } name = "<@name>" + name + "</@name>"; QString synopsis; - if (node->type() == Node::QmlProperty) { + if (node->isQmlProperty() || node->isJsProperty()) { const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node); synopsis = name + " : " + typified(pn->dataType()); } @@ -1083,50 +1083,50 @@ QString CppCodeMarker::addMarkUp(const QString &in, /*! This function is for documenting QML properties. It returns the list of documentation sections for the children of the - \a qmlClassNode. + \a qmlTypeNode. */ -QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisStyle style, Status status) +QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status) { QList<Section> sections; - if (qmlClassNode) { + if (qmlTypeNode) { if (style == Summary) { - FastSection qmlproperties(qmlClassNode, + FastSection qmlproperties(qmlTypeNode, "Properties", QString(), "property", "properties"); - FastSection qmlattachedproperties(qmlClassNode, + FastSection qmlattachedproperties(qmlTypeNode, "Attached Properties", QString(), "property", "properties"); - FastSection qmlsignals(qmlClassNode, + FastSection qmlsignals(qmlTypeNode, "Signals", QString(), "signal", "signals"); - FastSection qmlsignalhandlers(qmlClassNode, + FastSection qmlsignalhandlers(qmlTypeNode, "Signal Handlers", QString(), "signal handler", "signal handlers"); - FastSection qmlattachedsignals(qmlClassNode, + FastSection qmlattachedsignals(qmlTypeNode, "Attached Signals", QString(), "signal", "signals"); - FastSection qmlmethods(qmlClassNode, + FastSection qmlmethods(qmlTypeNode, "Methods", QString(), "method", "methods"); - FastSection qmlattachedmethods(qmlClassNode, + FastSection qmlattachedmethods(qmlTypeNode, "Attached Methods", QString(), "method", "methods"); - QmlClassNode* qcn = qmlClassNode; + QmlTypeNode* qcn = qmlTypeNode; while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { @@ -1134,10 +1134,10 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt ++c; continue; } - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { insert(qmlproperties, *c, style, status); } - else if ((*c)->type() == Node::QmlProperty) { + else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) { const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c); if (pn->isAttached()) insert(qmlattachedproperties,*c,style, status); @@ -1145,17 +1145,17 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt insert(qmlproperties,*c,style, status); } } - else if ((*c)->type() == Node::QmlSignal) { + else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) { const FunctionNode* sn = static_cast<const FunctionNode*>(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style, status); else insert(qmlsignals,*c,style, status); } - else if ((*c)->type() == Node::QmlSignalHandler) { + else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) { insert(qmlsignalhandlers,*c,style, status); } - else if ((*c)->type() == Node::QmlMethod) { + else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) { const FunctionNode* mn = static_cast<const FunctionNode*>(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style, status); @@ -1165,7 +1165,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt ++c; } if (qcn->qmlBaseNode() != 0) { - qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode()); + qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode()); if (!qcn->isAbstract()) qcn = 0; } @@ -1181,17 +1181,17 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt append(sections,qmlattachedmethods); } else if (style == Detailed) { - FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members"); - FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop", + FastSection qmlproperties(qmlTypeNode, "Property Documentation","qmlprop","member","members"); + FastSection qmlattachedproperties(qmlTypeNode,"Attached Property Documentation","qmlattprop", "member","members"); - FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","signal","signals"); - FastSection qmlsignalhandlers(qmlClassNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers"); - FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig", + FastSection qmlsignals(qmlTypeNode,"Signal Documentation","qmlsig","signal","signals"); + FastSection qmlsignalhandlers(qmlTypeNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers"); + FastSection qmlattachedsignals(qmlTypeNode,"Attached Signal Documentation","qmlattsig", "signal","signals"); - FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members"); - FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth", + FastSection qmlmethods(qmlTypeNode,"Method Documentation","qmlmeth","member","members"); + FastSection qmlattachedmethods(qmlTypeNode,"Attached Method Documentation","qmlattmeth", "member","members"); - QmlClassNode* qcn = qmlClassNode; + QmlTypeNode* qcn = qmlTypeNode; while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { @@ -1199,27 +1199,27 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt ++c; continue; } - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { insert(qmlproperties,*c,style, status); } - else if ((*c)->type() == Node::QmlProperty) { + else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) { const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c); if (pn->isAttached()) insert(qmlattachedproperties,*c,style, status); else insert(qmlproperties,*c,style, status); } - else if ((*c)->type() == Node::QmlSignal) { + else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) { const FunctionNode* sn = static_cast<const FunctionNode*>(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style, status); else insert(qmlsignals,*c,style, status); } - else if ((*c)->type() == Node::QmlSignalHandler) { + else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) { insert(qmlsignalhandlers,*c,style, status); } - else if ((*c)->type() == Node::QmlMethod) { + else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) { const FunctionNode* mn = static_cast<const FunctionNode*>(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style, status); @@ -1229,7 +1229,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt ++c; } if (qcn->qmlBaseNode() != 0) { - qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode()); + qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode()); if (!qcn->isAbstract()) qcn = 0; } @@ -1250,8 +1250,8 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt members is prepared. */ ClassMap* classMap = 0; - FastSection all(qmlClassNode,QString(),QString(),"member","members"); - QmlClassNode* current = qmlClassNode; + FastSection all(qmlTypeNode,QString(),QString(),"member","members"); + QmlTypeNode* current = qmlTypeNode; while (current != 0) { /* If the QML type is abstract, do not create @@ -1271,11 +1271,11 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt } NodeList::ConstIterator c = current->childNodes().constBegin(); while (c != current->childNodes().constEnd()) { - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c); NodeList::ConstIterator p = qpgn->childNodes().constBegin(); while (p != qpgn->childNodes().constEnd()) { - if ((*p)->type() == Node::QmlProperty) { + if ((*p)->isQmlProperty() || (*c)->isJsProperty()) { QString key = (*p)->name(); key = sortName(*p, &key); all.memberMap.insert(key,*p); |