summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/qdoc3/config.h4
-rw-r--r--tools/qdoc3/cppcodemarker.cpp24
-rw-r--r--tools/qdoc3/cppcodeparser.cpp21
-rw-r--r--tools/qdoc3/doc.cpp4
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp12
-rw-r--r--tools/qdoc3/htmlgenerator.cpp8
-rw-r--r--tools/qdoc3/node.cpp4
-rw-r--r--tools/qdoc3/node.h13
-rw-r--r--tools/qdoc3/test/classic.css7
-rw-r--r--tools/qdoc3/test/qt-cpp-ignore.qdocconf1
10 files changed, 75 insertions, 23 deletions
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index 07cdb59..725129a 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -162,6 +162,10 @@ class Config
#define CONFIG_FILEEXTENSIONS "fileextensions"
+#ifdef QDOC_QML
+#define CONFIG_QMLONLY "qmlonly"
+#endif
+
QT_END_NAMESPACE
#endif
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index a32f92b..c07be8b 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -353,6 +353,10 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary)
QString name = taggedQmlNode(node);
if (summary) {
name = linkTag(node,name);
+ } else if (node->type() == Node::QmlProperty) {
+ const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
+ if (pn->isAttached())
+ name.prepend(pn->element() + QLatin1Char('.'));
}
name = "<@name>" + name + "</@name>";
QString synopsis = name;
@@ -1109,15 +1113,15 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
if (qmlClassNode) {
if (style == Summary) {
FastSection qmlproperties(qmlClassNode,
- "QML Properties",
+ "Properties",
"property",
"properties");
FastSection qmlattachedproperties(qmlClassNode,
- "QML Attached Properties",
+ "Attached Properties",
"property",
"properties");
FastSection qmlsignals(qmlClassNode,
- "QML Signals",
+ "Signals",
"signal",
"signals");
FastSection qmlattachedsignals(qmlClassNode,
@@ -1125,7 +1129,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
"signal",
"signals");
FastSection qmlmethods(qmlClassNode,
- "QML Methods",
+ "Methods",
"method",
"methods");
FastSection qmlattachedmethods(qmlClassNode,
@@ -1173,12 +1177,12 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
append(sections,qmlattachedmethods);
}
else if (style == Detailed) {
- FastSection qmlproperties(qmlClassNode,"QML Property Documentation");
- FastSection qmlattachedproperties(qmlClassNode,"QML Attached Property Documentation");
- FastSection qmlsignals(qmlClassNode,"QML Signal Documentation");
- FastSection qmlattachedsignals(qmlClassNode,"QML Attached Signal Documentation");
- FastSection qmlmethods(qmlClassNode,"QML Method Documentation");
- FastSection qmlattachedmethods(qmlClassNode,"QML Attached Method Documentation");
+ FastSection qmlproperties(qmlClassNode, "Property Documentation");
+ FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation");
+ FastSection qmlsignals(qmlClassNode,"Signal Documentation");
+ FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation");
+ FastSection qmlmethods(qmlClassNode,"Method Documentation");
+ FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation");
NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
while (c != qmlClassNode->childNodes().end()) {
if ((*c)->subType() == Node::QmlPropertyGroup) {
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 843bec8..cabbe38 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/doc.cpp b/tools/qdoc3/doc.cpp
index 748390f..f4931b8 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -2841,6 +2841,10 @@ void Doc::initialize(const Config& config)
DocParser::sourceDirs = config.getStringList(CONFIG_SOURCEDIRS);
DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION);
+#ifdef QDOC_QML
+ QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
+#endif
+
QStringMap reverseAliasMap;
QSet<QString> commands = config.subVars(CONFIG_ALIAS);
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 4973387..52f54c0 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -187,8 +187,16 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
details << node->parent()->name()+"::"+node->name();
} else if (node->type() == Node::Fake) {
const FakeNode *fake = static_cast<const FakeNode *>(node);
- details << fake->fullTitle();
- details << fake->fullTitle();
+#ifdef QDOC_QML
+ if (fake->subType() == Node::QmlClass) {
+ details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle());
+ details << "QML." + fake->name();
+ } else
+#endif
+ {
+ details << fake->fullTitle();
+ details << fake->fullTitle();
+ }
} else {
details << node->name();
details << node->name();
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index eaf4b2e..afd1e74 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4192,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()) {
@@ -4279,7 +4281,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn,
}
/*!
- Output the "[Xxx instantiates the C++ class QFxXxx]"
+ Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]"
line for the QML element, if there should be one.
If there is no class node, or if the class node status
@@ -4309,7 +4311,7 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
}
/*!
- Output the "[QFxXxx is instantiated by QML element Xxx]"
+ Output the "[QmlGraphicsXxx is instantiated by QML element Xxx]"
line for the class, if there should be one.
If there is no QML element, or if the class node status
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 61855bc..ecb4a44 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1127,6 +1127,8 @@ bool TargetNode::isInnerNode() const
}
#ifdef QDOC_QML
+bool QmlClassNode::qmlOnly = false;
+
/*!
Constructor for the Qml class node.
*/
@@ -1135,7 +1137,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
const ClassNode* cn)
: FakeNode(parent, name, QmlClass), cnode(cn)
{
- setTitle("QML " + name + " Element Reference");
+ setTitle((qmlOnly ? "" : "QML ") + name + " Element Reference");
}
/*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 20ccb95..5712879 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -362,6 +362,8 @@ class QmlClassNode : public FakeNode
const ClassNode* classNode() const { return cnode; }
virtual QString fileBase() const;
+ static bool qmlOnly;
+
private:
const ClassNode* cnode;
};
@@ -374,7 +376,7 @@ class QmlPropGroupNode : public FakeNode
bool attached);
virtual ~QmlPropGroupNode() { }
- const QString& element() const { return name(); }
+ const QString& element() const { return parent()->name(); }
void setDefault() { isdefault = true; }
bool isDefault() const { return isdefault; }
bool isAttached() const { return att; }
@@ -396,14 +398,16 @@ 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 parent()->name(); }
+ const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); }
private:
enum Trool { Trool_True, Trool_False, Trool_Default };
@@ -414,6 +418,7 @@ class QmlPropertyNode : public LeafNode
QString dt;
Trool sto;
Trool des;
+ Trool wri;
bool att;
};
@@ -635,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; }
@@ -647,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:
@@ -657,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/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 {
}
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index 1efc215..dcf33dc 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -69,6 +69,7 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
QT_END_NAMESPACE \
QT_END_INCLUDE_NAMESPACE \
PHONON_EXPORT \
+ Q_DECLARATIVE_EXPORT \
Q_GADGET \
QWEBKIT_EXPORT
Cpp.ignoredirectives = Q_DECLARE_HANDLE \