diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-04 00:42:24 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-04 00:44:18 +0200 |
commit | d8fc0da235b2bd566b2b6f1e21218afdf2f34eb3 (patch) | |
tree | c0ca819521ed6901a83ab476fa822a886691d806 /src/tools/qdoc/node.cpp | |
parent | 3649a6e61d823289d18be19387d7e3923dd90bd0 (diff) | |
parent | cdf0c5905b3477c6cd01c519f883b7bb55447120 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/plugins/platforms/minimal/qminimalintegration.cpp
src/plugins/platforms/offscreen/qoffscreenintegration.cpp
Change-Id: Ica85deeab5c5038ac004718e25194b1157343480
Diffstat (limited to 'src/tools/qdoc/node.cpp')
-rw-r--r-- | src/tools/qdoc/node.cpp | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index fd56c77742..66e0455074 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -2122,6 +2122,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name) cnodeRequired_(false), wrapper_(false), cnode_(0), + qmlModule_(0), baseNode_(0) { int i = 0; @@ -2171,45 +2172,27 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs) } } -/*! \fn QString QmlClassNode::qmlModuleIdentifier() const - This function is called to get a string that is used either - as a prefix for the file name to use for QML element or - component reference page, or as a qualifier to prefix a - reference to a QML element or comnponent. The string that - is returned is the concatenation of the QML module name - and its version number. e.g., if an element or component - is defined to be in the QML module QtQuick 1, its module - identifier is "QtQuick1". See setQmlModuleInfo(). - */ - /*! This function splits \a arg on the blank character to get a - QML module name and version number. It then spilts the version - number on the '.' character to get a major version number and - a minor vrsion number. Both major the major and minor version - numbers should be present, but the minor version number is not + QML module name and version number. If the version number is + present, it spilts the version number on the '.' character to + get a major version number and a minor vrsion number. If the + version number is present, both the major and minor version + numbers should be there, but the minor version number is not absolutely necessary. - - It stores the three components separately in this node. If all - three are found, true is returned. If any of the three is not - found or is not in the correct format, false is returned. */ -bool Node::setQmlModuleInfo(const QString& arg) +void QmlModuleNode::setQmlModuleInfo(const QString& arg) { - QStringList dotSplit; QStringList blankSplit = arg.split(QLatin1Char(' ')); qmlModuleName_ = blankSplit[0]; - qmlModuleVersionMajor_ = "1"; - qmlModuleVersionMinor_ = "0"; if (blankSplit.size() > 1) { - dotSplit = blankSplit[1].split(QLatin1Char('.')); + QStringList dotSplit = blankSplit[1].split(QLatin1Char('.')); qmlModuleVersionMajor_ = dotSplit[0]; - if (dotSplit.size() > 1) { + if (dotSplit.size() > 1) qmlModuleVersionMinor_ = dotSplit[1]; - return true; - } + else + qmlModuleVersionMinor_ = "0"; } - return false; } /*! @@ -2259,6 +2242,36 @@ void QmlClassNode::clearCurrentChild() } /*! + If the QML type's QML module pointer is set, return the QML + module name from the QML module node. Otherwise, return the + empty string. + */ +QString QmlClassNode::qmlModuleName() const +{ + return (qmlModule_ ? qmlModule_->qmlModuleName() : QString()); +} + +/*! + If the QML type's QML module pointer is set, return the QML + module version from the QML module node. Otherwise, return + the empty string. + */ +QString QmlClassNode::qmlModuleVersion() const +{ + return (qmlModule_ ? qmlModule_->qmlModuleVersion() : QString()); +} + +/*! + If the QML type's QML module pointer is set, return the QML + module identifier from the QML module node. Otherwise, return + the empty string. + */ +QString QmlClassNode::qmlModuleIdentifier() const +{ + return (qmlModule_ ? qmlModule_->qmlModuleIdentifier() : QString()); +} + +/*! Constructs a Qml basic type node (i.e. a Document node with the subtype QmlBasicType. The new node has the given \a parent and \a name. @@ -2526,7 +2539,7 @@ QString Node::fullDocumentName() const if (n->type() == Node::Document) { if ((n->subType() == Node::QmlClass) && !n->qmlModuleName().isEmpty()) - pieces.insert(0, n->qmlModuleIdentifier()); + pieces.insert(0, n->qmlModuleName()); break; } |