diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-30 06:33:48 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-30 06:33:48 (GMT) |
commit | 4aaacb65d75ed58d5b69204f5bd53dc0acee1644 (patch) | |
tree | fae3869d7e4a56ac2d77dfbfae15c18316359d0a /tools/qdoc3 | |
parent | 9c8774e4aff4e21eb7dc4b98ce525e0b1a8285f6 (diff) | |
parent | fed23e1171d12c4b069652acacc2d718c9691c12 (diff) | |
download | Qt-4aaacb65d75ed58d5b69204f5bd53dc0acee1644.zip Qt-4aaacb65d75ed58d5b69204f5bd53dc0acee1644.tar.gz Qt-4aaacb65d75ed58d5b69204f5bd53dc0acee1644.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
src/declarative/debugger/qmldebug.cpp
src/declarative/fx/qmlgraphicsimagebase_p.h
src/declarative/util/qmlanimation.h
src/declarative/util/qmlstate.h
src/declarative/util/qmltimer.cpp
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 21 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 15 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 7 | ||||
-rw-r--r-- | tools/qdoc3/pagegenerator.cpp | 19 | ||||
-rw-r--r-- | tools/qdoc3/test/classic.css | 7 |
5 files changed, 47 insertions, 22 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 84ec3f4..509613a 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -799,14 +799,26 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, } } if (qmlPropGroup) { - new QmlPropertyNode(qmlPropGroup,property,type,attached); + const ClassNode *correspondingClass = static_cast<const QmlClassNode*>(qmlPropGroup->parent())->classNode(); + PropertyNode *correspondingProperty = 0; + if (correspondingClass) + correspondingProperty = static_cast<PropertyNode*>((Node*)correspondingClass->findNode(property, Node::Property)); + QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup,property,type,attached); + if (correspondingProperty) { + bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); + qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + } ++arg; while (arg != args.end()) { if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { - new QmlPropertyNode(qmlPropGroup, + QmlPropertyNode * qmlPropNode = new QmlPropertyNode(qmlPropGroup, property, type, attached); + if (correspondingProperty) { + bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); + qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + } } ++arg; } @@ -1751,9 +1763,10 @@ bool CppCodeParser::matchProperty(InnerNode *parent) if (key == "READ") tre->addPropertyFunction(property, value, PropertyNode::Getter); - else if (key == "WRITE") + else if (key == "WRITE") { tre->addPropertyFunction(property, value, PropertyNode::Setter); - else if (key == "STORED") + property->setWritable(true); + } else if (key == "STORED") property->setStored(value.toLower() == "true"); else if (key == "DESIGNABLE") property->setDesignable(value.toLower() == "true"); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c5ea308..afd1e74 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3467,10 +3467,13 @@ QString HtmlGenerator::refForNode(const Node *node) ref += "-" + QString::number(func->overloadNumber()); } break; - case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML + case Node::Fake: + if (node->subType() != Node::QmlPropertyGroup) + break; case Node::QmlProperty: #endif + case Node::Property: ref = node->name() + "-prop"; break; #ifdef QDOC_QML @@ -3512,9 +3515,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) // ### reintroduce this test, without breaking .dcf files if (fn != outFileName()) #endif - link += fn; + link += fn; - if (!node->isInnerNode()) { + if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { ref = refForNode(node); if (relative && fn == fileName(relative) && ref == refForNode(relative)) return QString(); @@ -4189,13 +4192,15 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node); NodeList::ConstIterator p = qpgn->childNodes().begin(); out() << "<div class=\"qmlproto\">"; - out() << "<table class=\"qmlname\">"; + out() << "<table width=\"100%\" class=\"qmlname\">"; while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { qpn = static_cast<const QmlPropertyNode*>(*p); out() << "<tr><td>"; out() << "<a name=\"" + refForNode(qpn) + "\"></a>"; + if (!qpn->isWritable()) + out() << "<span class=\"qmlreadonly\">read-only</span>"; generateQmlItem(qpn, relative, marker, false); out() << "</td></tr>"; if (qpgn->isDefault()) { diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 3252964..5712879 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -398,11 +398,13 @@ class QmlPropertyNode : public LeafNode void setDataType(const QString& dataType) { dt = dataType; } void setStored(bool stored) { sto = toTrool(stored); } void setDesignable(bool designable) { des = toTrool(designable); } + void setWritable(bool writable) { wri = toTrool(writable); } const QString &dataType() const { return dt; } QString qualifiedDataType() const { return dt; } bool isStored() const { return fromTrool(sto,true); } bool isDesignable() const { return fromTrool(des,false); } + bool isWritable() const { return fromTrool(wri,true); } bool isAttached() const { return att; } const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); } @@ -416,6 +418,7 @@ class QmlPropertyNode : public LeafNode QString dt; Trool sto; Trool des; + Trool wri; bool att; }; @@ -637,6 +640,7 @@ class PropertyNode : public LeafNode void addSignal(FunctionNode *function, FunctionRole role); void setStored(bool stored) { sto = toTrool(stored); } void setDesignable(bool designable) { des = toTrool(designable); } + void setWritable(bool writable) { wri = toTrool(writable); } void setOverriddenFrom(const PropertyNode *baseProperty); const QString &dataType() const { return dt; } @@ -649,6 +653,7 @@ class PropertyNode : public LeafNode NodeList notifiers() const { return functions(Notifier); } bool isStored() const { return fromTrool(sto, storedDefault()); } bool isDesignable() const { return fromTrool(des, designableDefault()); } + bool isWritable() const { return fromTrool(wri, writableDefault()); } const PropertyNode *overriddenFrom() const { return overrides; } private: @@ -659,11 +664,13 @@ class PropertyNode : public LeafNode bool storedDefault() const { return true; } bool designableDefault() const { return !setters().isEmpty(); } + bool writableDefault() const { return !setters().isEmpty(); } QString dt; NodeList funcs[NumFunctionRoles]; Trool sto; Trool des; + Trool wri; const PropertyNode *overrides; }; diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 83ea561..7d9fbee 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -81,14 +81,13 @@ QString PageGenerator::fileBase(const Node *node) { if (node->relates()) node = node->relates(); - else if (!node->isInnerNode()) { + else if (!node->isInnerNode()) node = node->parent(); #ifdef QDOC_QML - if (node->subType() == Node::QmlPropertyGroup) { - node = node->parent(); - } -#endif + if (node->subType() == Node::QmlPropertyGroup) { + node = node->parent(); } +#endif QString base = node->doc().baseName(); if (!base.isEmpty()) @@ -97,6 +96,7 @@ QString PageGenerator::fileBase(const Node *node) const Node *p = node; forever { + const Node *pp = p->parent(); base.prepend(p->name()); #ifdef QDOC_QML /* @@ -104,15 +104,10 @@ QString PageGenerator::fileBase(const Node *node) we prepend "qml-" to the file name of QML element doc files. */ - if ((p->subType() == Node::QmlClass) || - (p->subType() == Node::QmlPropertyGroup)) - base.prepend("qml-"); - else if ((p->type() == Node::QmlProperty) || - (p->type() == Node::QmlSignal) || - (p->type() == Node::QmlMethod)) + if (p->subType() == Node::QmlClass) { base.prepend("qml-"); + } #endif - const Node *pp = p->parent(); if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake) break; base.prepend(QLatin1Char('-')); diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 320da66..b8cae8e 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -268,10 +268,15 @@ span.string,span.char border-style: solid; border-color: #ddd; font-weight: bold; - padding: 6px 0px 6px 10px; + padding: 6px 10px 6px 10px; margin: 42px 0px 0px 0px; } +.qmlreadonly { + float: right; + color: red +} + .qmldoc { } |