summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qmlvisitor.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2012-07-26 10:48:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-26 14:24:40 +0200
commit3658eedc971a62a5ea8b202e0dd9f89abacdb61e (patch)
tree8b4fd5a0d7e7cc6cd07733ddb7d68060177951a5 /src/tools/qdoc/qmlvisitor.cpp
parent353069f974c62ef758b1496881a03fcb6ca51476 (diff)
qdoc: Changed \qmlclass to \qmltype, added \instantiates
The \qmlclass qdoc command is now deprecated. Use \qmltype instead. \qmlclass had two arguments, the QML type name and, if the QML type was elemental, the name of the C++ class that the QML element instantiates. The \qmltype command has only one argument, the QML type name. If the QML type is elemental, then the \qmltype command should be followed by a \instantiates context command in the same qdoc comment. e.g.: \qmltype Item \instantiates QDeclarativeItem When the developer does not include the \instantiates command for an elemental QML type, qdoc will no longer be able to detect that the C++ class name is missing, and qdoc will no longer be able to detect when the name specified for a \qmlproperty of the elemental QML type has the wrong name. Task nr: QTBUG-26648 Change-Id: Ia60872a35113a6f615bfc751ce1e9db6279dfb8e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'src/tools/qdoc/qmlvisitor.cpp')
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index f4ce6e5038..76b6308bd0 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -62,10 +62,12 @@ QT_BEGIN_NAMESPACE
#define COMMAND_QMLABSTRACT Doc::alias(QLatin1String("qmlabstract"))
#define COMMAND_QMLCLASS Doc::alias(QLatin1String("qmlclass"))
+#define COMMAND_QMLTYPE Doc::alias(QLatin1String("qmltype"))
#define COMMAND_QMLMODULE Doc::alias(QLatin1String("qmlmodule"))
#define COMMAND_QMLPROPERTY Doc::alias(QLatin1String("qmlproperty"))
#define COMMAND_QMLATTACHEDPROPERTY Doc::alias(QLatin1String("qmlattachedproperty"))
#define COMMAND_QMLINHERITS Doc::alias(QLatin1String("inherits"))
+#define COMMAND_QMLINSTANTIATES Doc::alias(QLatin1String("instantiates"))
#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
#define COMMAND_QMLSIGNAL Doc::alias(QLatin1String("qmlsignal"))
#define COMMAND_QMLATTACHEDSIGNAL Doc::alias(QLatin1String("qmlattachedsignal"))
@@ -269,7 +271,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
}
if (!topic.isEmpty()) {
args = doc.metaCommandArgs(topic);
- if (topic == COMMAND_QMLCLASS) {
+ if ((topic == COMMAND_QMLCLASS) || (topic == COMMAND_QMLTYPE)) {
// do nothing.
}
else if (topic == COMMAND_QMLPROPERTY) {
@@ -389,7 +391,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
nestingLevel++;
if (current->type() == Node::Namespace) {
- QmlClassNode *component = new QmlClassNode(current, name, 0);
+ QmlClassNode *component = new QmlClassNode(current, name);
component->setTitle(name);
component->setImportList(importList);