summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/cppcodemarker.cpp19
-rw-r--r--tools/qdoc3/cppcodeparser.cpp23
-rw-r--r--tools/qdoc3/htmlgenerator.cpp6
-rw-r--r--tools/qdoc3/node.cpp14
-rw-r--r--tools/qdoc3/node.h11
5 files changed, 56 insertions, 17 deletions
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index 1062f9c..3bee3d9 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -1112,6 +1112,10 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
"Properties",
"property",
"properties");
+ FastSection qmlattachedproperties(qmlClassNode,
+ "Attached Properties",
+ "property",
+ "properties");
FastSection qmlsignals(qmlClassNode,
"Signals",
"signal",
@@ -1128,7 +1132,11 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
NodeList::ConstIterator p = qpgn->childNodes().begin();
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
- insert(qmlproperties,*p,style,Okay);
+ const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p);
+ if (pn->isAttached())
+ insert(qmlattachedproperties,*p,style,Okay);
+ else
+ insert(qmlproperties,*p,style,Okay);
}
++p;
}
@@ -1142,17 +1150,23 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}
else if (style == Detailed) {
FastSection qmlproperties(qmlClassNode, "Property Documentation");
+ FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation");
FastSection qmlsignals(qmlClassNode,"Signal Documentation");
FastSection qmlmethods(qmlClassNode,"Method Documentation");
NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
while (c != qmlClassNode->childNodes().end()) {
if ((*c)->subType() == Node::QmlPropertyGroup) {
- insert(qmlproperties,*c,style,Okay);
+ const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c);
+ if (pgn->isAttached())
+ insert(qmlattachedproperties,*c,style,Okay);
+ else
+ insert(qmlproperties,*c,style,Okay);
}
else if ((*c)->type() == Node::QmlSignal) {
insert(qmlsignals,*c,style,Okay);
@@ -1163,6 +1177,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index d93e24c..ad43b2b 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE
#ifdef QDOC_QML
#define COMMAND_QMLCLASS Doc::alias("qmlclass")
#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty")
+#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty")
#define COMMAND_QMLINHERITS Doc::alias("inherits")
#define COMMAND_QMLSIGNAL Doc::alias("qmlsignal")
#define COMMAND_QMLMETHOD Doc::alias("qmlmethod")
@@ -482,6 +483,7 @@ QSet<QString> CppCodeParser::topicCommands()
<< COMMAND_VARIABLE
<< COMMAND_QMLCLASS
<< COMMAND_QMLPROPERTY
+ << COMMAND_QMLATTACHEDPROPERTY
<< COMMAND_QMLSIGNAL
<< COMMAND_QMLMETHOD;
#else
@@ -759,32 +761,40 @@ bool CppCodeParser::splitQmlArg(const Doc& doc,
/*!
Process the topic \a command group with arguments \a args.
- Currently, this function is called only for \e{qmlproperty}.
+ Currently, this function is called only for \e{qmlproperty}
+ and \e{qmlattachedproperty}.
*/
Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
const QString& command,
const QStringList& args)
{
QmlPropGroupNode* qmlPropGroup = 0;
- if (command == COMMAND_QMLPROPERTY) {
+ if ((command == COMMAND_QMLPROPERTY) ||
+ (command == COMMAND_QMLATTACHEDPROPERTY)) {
QString type;
QString element;
QString property;
+ bool attached = (command == COMMAND_QMLATTACHEDPROPERTY);
QStringList::ConstIterator arg = args.begin();
if (splitQmlPropertyArg(doc,(*arg),type,element,property)) {
Node* n = tre->findNode(QStringList(element),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(n);
if (qmlClass)
- qmlPropGroup = new QmlPropGroupNode(qmlClass,property);
+ qmlPropGroup = new QmlPropGroupNode(qmlClass,
+ property,
+ attached);
}
}
if (qmlPropGroup) {
- new QmlPropertyNode(qmlPropGroup,property,type);
+ new QmlPropertyNode(qmlPropGroup,property,type,attached);
++arg;
while (arg != args.end()) {
if (splitQmlPropertyArg(doc,(*arg),type,element,property)) {
- new QmlPropertyNode(qmlPropGroup,property,type);
+ new QmlPropertyNode(qmlPropGroup,
+ property,
+ type,
+ attached);
}
++arg;
}
@@ -1969,7 +1979,8 @@ bool CppCodeParser::matchDocsAndStuff()
There is a topic command. Process it.
*/
#ifdef QDOC_QML
- if (topic == COMMAND_QMLPROPERTY) {
+ if ((topic == COMMAND_QMLPROPERTY) ||
+ (topic == COMMAND_QMLATTACHEDPROPERTY)) {
Doc nodeDoc = doc;
Node *node = processTopicCommandGroup(nodeDoc,topic,args);
if (node != 0) {
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index c02dc2e..18c7916 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1240,7 +1240,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
generateHeader(title, inner, marker, true);
generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
-#ifdef QDOC_QML
+#ifdef QDOC_QML
if (classe && !classe->qmlElement().isEmpty()) {
generateInstantiatedBy(classe,marker);
}
@@ -3468,12 +3468,12 @@ QString HtmlGenerator::refForNode(const Node *node)
}
break;
case Node::Property:
-#ifdef QDOC_QML
+#ifdef QDOC_QML
case Node::QmlProperty:
#endif
ref = node->name() + "-prop";
break;
-#ifdef QDOC_QML
+#ifdef QDOC_QML
case Node::QmlSignal:
ref = node->name() + "-signal";
break;
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 4315011..d47c478 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1160,8 +1160,12 @@ QString QmlClassNode::fileBase() const
Constructor for the Qml property group node. \a parent is
always a QmlClassNode.
*/
-QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
- : FakeNode(parent, name, QmlPropertyGroup), isdefault(false)
+QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent,
+ const QString& name,
+ bool attached)
+ : FakeNode(parent, name, QmlPropertyGroup),
+ isdefault(false),
+ att(attached)
{
// nothing.
}
@@ -1171,11 +1175,13 @@ QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
*/
QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent,
const QString& name,
- const QString& type)
+ const QString& type,
+ bool attached)
: LeafNode(QmlProperty, parent, name),
dt(type),
sto(Trool_Default),
- des(Trool_Default)
+ des(Trool_Default),
+ att(attached)
{
// nothing.
}
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index dbc3963..c6f860f 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -371,15 +371,19 @@ class QmlClassNode : public FakeNode
class QmlPropGroupNode : public FakeNode
{
public:
- QmlPropGroupNode(QmlClassNode* parent, const QString& name);
+ QmlPropGroupNode(QmlClassNode* parent,
+ const QString& name,
+ bool attached);
virtual ~QmlPropGroupNode() { }
const QString& element() const { return name(); }
void setDefault() { isdefault = true; }
bool isDefault() const { return isdefault; }
+ bool isAttached() const { return att; }
private:
bool isdefault;
+ bool att;
};
class QmlPropertyNode : public LeafNode
@@ -387,7 +391,8 @@ class QmlPropertyNode : public LeafNode
public:
QmlPropertyNode(QmlPropGroupNode* parent,
const QString& name,
- const QString& type);
+ const QString& type,
+ bool attached);
virtual ~QmlPropertyNode() { }
void setDataType(const QString& dataType) { dt = dataType; }
@@ -398,6 +403,7 @@ class QmlPropertyNode : public LeafNode
QString qualifiedDataType() const { return dt; }
bool isStored() const { return fromTrool(sto,true); }
bool isDesignable() const { return fromTrool(des,false); }
+ bool isAttached() const { return att; }
const QString& element() const { return parent()->name(); }
@@ -410,6 +416,7 @@ class QmlPropertyNode : public LeafNode
QString dt;
Trool sto;
Trool des;
+ bool att;
};
class QmlSignalNode : public LeafNode