diff options
author | Martin Smith <martin.smith@digia.com> | 2015-08-11 11:58:02 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-08-16 14:48:06 +0000 |
commit | 330da82cc2b51a96ebcf021746e14304a1c9a68b (patch) | |
tree | c172690750354e198d0cc78e7f02b838b6df0ad5 | |
parent | 8c5ce68fcf09d128072c31d74878fcb0fd9b9c7a (diff) | |
download | qtbase-330da82cc2b51a96ebcf021746e14304a1c9a68b.tar.gz |
qdoc: Instantiator::objectAt now appear in docs
There was a bug in bool CppCodeParser::splitQmlMethodArg(),
which has now been fixed. The bug occurred when there was a
"::" in the return type.
Change-Id: Id31ed0d4a03d84e76fb69403441a3491ec884ddc
Task-number: QTBUG-47438
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
-rw-r--r-- | src/tools/qdoc/cppcodeparser.cpp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 8d9596c10b..0f70777256 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -687,10 +687,10 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, <type> <QML-type>::<name>(<param>, <param>, ...) <type> <QML-module>::<QML-type>::<name>(<param>, <param>, ...) - This function splits the argument into one of those two - forms, sets \a module, \a qmlTypeName, and \a name, and returns - true. If the argument doesn't match either form, an error - message is emitted and false is returned. + This function splits the \a{arg}ument into one of those + two forms, sets \a type, \a module, and \a qmlTypeName, + and returns true. If the argument doesn't match either + form, an error message is emitted and false is returned. \note The two QML types \e{Component} and \e{QtObject} never have a module qualifier. @@ -700,30 +700,29 @@ bool CppCodeParser::splitQmlMethodArg(const QString& arg, QString& module, QString& qmlTypeName) { - QStringList colonSplit(arg.split("::")); + QString name; + int leftParen = arg.indexOf(QChar('(')); + if (leftParen > 0) + name = arg.left(leftParen); + else + name = arg; + int firstBlank = name.indexOf(QChar(' ')); + if (firstBlank > 0) { + type = name.left(firstBlank); + name = name.right(name.length() - firstBlank - 1); + } + else + type.clear(); + + QStringList colonSplit(name.split("::")); if (colonSplit.size() > 1) { - QStringList blankSplit = colonSplit[0].split(QLatin1Char(' ')); - if (blankSplit.size() > 1) { - type = blankSplit[0]; - if (colonSplit.size() > 2) { - module = blankSplit[1]; - qmlTypeName = colonSplit[1]; - } - else { - module.clear(); - qmlTypeName = blankSplit[1]; - } + if (colonSplit.size() > 2) { + module = colonSplit[0]; + qmlTypeName = colonSplit[1]; } else { - type.clear(); - if (colonSplit.size() > 2) { - module = colonSplit[0]; - qmlTypeName = colonSplit[1]; - } - else { - module.clear(); - qmlTypeName = colonSplit[0]; - } + module.clear(); + qmlTypeName = colonSplit[0]; } return true; } |