summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-07-22 13:27:43 +0200
committerMartin Smith <martin.smith@nokia.com>2010-07-22 13:27:43 +0200
commitd8908922f339892fee4275a433e2bf6da87ae055 (patch)
tree5a6c360e74f434b0b017a489bce5d08082866c28
parentbad44806fd543b91777b69d9afb0e1dd4910b15a (diff)
downloadqt4-tools-d8908922f339892fee4275a433e2bf6da87ae055.tar.gz
qdoc: Fixed reporting of read-only status for QML properties.
Task-number: QTBUG-11512
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp20
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp1
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp2
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp8
-rw-r--r--tools/qdoc3/cppcodeparser.cpp32
-rw-r--r--tools/qdoc3/cppcodeparser.h1
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp2
-rw-r--r--tools/qdoc3/htmlgenerator.cpp13
-rw-r--r--tools/qdoc3/node.cpp218
-rw-r--r--tools/qdoc3/node.h18
-rw-r--r--tools/qdoc3/test/qt-cpp-ignore.qdocconf4
-rw-r--r--tools/qdoc3/tokenizer.cpp6
-rw-r--r--tools/qdoc3/tokenizer.h2
-rw-r--r--tools/qdoc3/tree.cpp9
16 files changed, 281 insertions, 68 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
index 1bd7608935..c9297977fb 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -70,11 +70,11 @@ class Q_DECLARATIVE_EXPORT QDeclarativeAnchors : public QObject
Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
- Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged())
+ Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged)
Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
- Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged())
- Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged())
+ Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged)
+ Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 67f2327023..ba40443933 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -50,6 +50,13 @@
QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativeImageBase
+ \internal
+ \brief The base class for declarative images.
+ */
+
QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent)
: QDeclarativeItem(dd, parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9a1a1a06a2..0c1a7af616 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlclass Translate QGraphicsTranslate
+ \qmlclass Translate QDeclarativeTranslate
\since 4.7
\brief The Translate object provides a way to move an Item without changing its x or y properties.
@@ -420,7 +420,7 @@ void QDeclarativeItemKeyFilter::componentComplete()
/*!
- \qmlclass KeyNavigation
+ \qmlclass KeyNavigation QDeclarativeKeyNavigationAttached
\since 4.7
\brief The KeyNavigation attached property supports key navigation by arrow keys.
@@ -714,7 +714,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
}
/*!
- \qmlclass Keys
+ \qmlclass Keys QDeclarativeKeysAttached
\since 4.7
\brief The Keys attached property provides key handling to Items.
@@ -2047,20 +2047,6 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
}
/*!
- \qmlproperty AnchorLine Item::top
- \qmlproperty AnchorLine Item::bottom
- \qmlproperty AnchorLine Item::left
- \qmlproperty AnchorLine Item::right
- \qmlproperty AnchorLine Item::horizontalCenter
- \qmlproperty AnchorLine Item::verticalCenter
- \qmlproperty AnchorLine Item::baseline
-
- The anchor lines of the item.
-
- For more information see \l {anchor-layout}{Anchor Layouts}.
-*/
-
-/*!
\qmlproperty AnchorLine Item::anchors.top
\qmlproperty AnchorLine Item::anchors.bottom
\qmlproperty AnchorLine Item::anchors.left
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 3be4014154..2b268fbe7b 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -148,7 +148,6 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\internal
\class QDeclarativeRepeater
- \qmlclass Repeater
*/
/*!
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index 9cf81ca46f..2f4d1dfa42 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -93,7 +93,7 @@ public:
};
/*!
- \qmlclass FolderListModel
+ \qmlclass FolderListModel QDeclarativeFolderListModel
\brief The FolderListModel provides a model of the contents of a folder in a filesystem.
FolderListModel provides access to the local filesystem. The \e folder property
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index e95dfc7f36..916021c3ed 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -153,7 +153,7 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
}
/*!
- \qmlclass ParticleMotionLinear
+ \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
\since 4.7
\brief The ParticleMotionLinear object moves particles linearly.
@@ -174,7 +174,7 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
}
/*!
- \qmlclass ParticleMotionGravity
+ \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
\since 4.7
\brief The ParticleMotionGravity object moves particles towards a point.
@@ -257,7 +257,7 @@ void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int int
}
/*!
- \qmlclass ParticleMotionWander
+ \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
\since 4.7
\brief The ParticleMotionWander object moves particles in a somewhat random fashion.
@@ -620,7 +620,7 @@ void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int ag
}
/*!
- \qmlclass Particles
+ \qmlclass Particles QDeclarativeParticles
\since 4.7
\brief The Particles object generates and moves particles.
\inherits Item
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index d5108fd770..a120e4566b 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -1120,6 +1120,17 @@ bool CppCodeParser::match(int target)
}
/*!
+ Skip to \a target. If \a target is found before the end
+ of input, return true. Otherwise return false.
+ */
+bool CppCodeParser::skipTo(int target)
+{
+ while ((tok != Tok_Eoi) && (tok != target))
+ readToken();
+ return (tok == target ? true : false);
+}
+
+/*!
If the current token is one of the keyword thingees that
are used in Qt, skip over it to the next token and return
true. Otherwise just return false without reading the
@@ -1362,7 +1373,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
if (!matchDataType(&returnType)) {
if (tokenizer->parsingFnOrMacro()
- && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY)))
+ && (match(Tok_Q_DECLARE_FLAGS) ||
+ match(Tok_Q_PROPERTY) ||
+ match(Tok_Q_PRIVATE_PROPERTY)))
returnType = CodeChunk(previousLexeme());
else {
return false;
@@ -1796,11 +1809,19 @@ bool CppCodeParser::matchTypedefDecl(InnerNode *parent)
bool CppCodeParser::matchProperty(InnerNode *parent)
{
- if (!match(Tok_Q_PROPERTY) &&
- !match(Tok_Q_OVERRIDE) &&
- !match(Tok_QDOC_PROPERTY))
+ int expected_tok = Tok_LeftParen;
+ if (match(Tok_Q_PRIVATE_PROPERTY)) {
+ expected_tok = Tok_Comma;
+ if (!skipTo(Tok_Comma))
+ return false;
+ }
+ else if (!match(Tok_Q_PROPERTY) &&
+ !match(Tok_Q_OVERRIDE) &&
+ !match(Tok_QDOC_PROPERTY)) {
return false;
- if (!match(Tok_LeftParen))
+ }
+
+ if (!match(expected_tok))
return false;
QString name;
@@ -1949,6 +1970,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
break;
case Tok_Q_OVERRIDE:
case Tok_Q_PROPERTY:
+ case Tok_Q_PRIVATE_PROPERTY:
case Tok_QDOC_PROPERTY:
matchProperty(parent);
break;
diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h
index 3c53f72ddb..55d9ddf552 100644
--- a/tools/qdoc3/cppcodeparser.h
+++ b/tools/qdoc3/cppcodeparser.h
@@ -119,6 +119,7 @@ class CppCodeParser : public CodeParser
QString previousLexeme();
QString lexeme();
bool match(int target);
+ bool skipTo(int target);
bool matchCompat();
bool matchTemplateAngles(CodeChunk *type = 0);
bool matchTemplateHeader();
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index d7a9c9e8cc..4789c671f9 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -4210,7 +4210,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node,
out() << "<td><p>";
//out() << "<tr><td>"; // old
out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
- if (!qpn->isWritable())
+ if (!qpn->isWritable(myTree))
out() << "<span class=\"qmlreadonly\">read-only</span>";
if (qpgn->isDefault())
out() << "<span class=\"qmldefault\">default</span>";
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index f281fd4fd4..071c522b29 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4094,8 +4094,11 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
out() << "<td class=\"tblQmlPropNode\"><p>";
out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
- if (!qpn->isWritable())
+
+ if (!qpn->isWritable(myTree)) {
+ qDebug() << "QPN:" << qpn->name();
out() << "<span class=\"qmlreadonly\">read-only</span>";
+ }
if (qpgn->isDefault())
out() << "<span class=\"qmldefault\">default</span>";
generateQmlItem(qpn, relative, marker, false);
@@ -4111,10 +4114,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
out() << "<div class=\"qmlproto\">";
out() << "<table class=\"qmlname\">";
//out() << "<tr>";
- if (++numTableRows % 2 == 1)
- out() << "<tr class=\"odd\">";
- else
- out() << "<tr class=\"even\">";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd\">";
+ else
+ out() << "<tr class=\"even\">";
out() << "<td class=\"tblQmlFuncNode\"><p>";
out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index da62e29db7..28347c3a64 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -44,6 +44,8 @@
*/
#include "node.h"
+#include "tree.h"
+#include "codemarker.h"
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -171,6 +173,32 @@ QString Node::accessString() const
return "public";
}
+/*!
+ Extract a class name from the type \a string and return it.
+ */
+QString Node::extractClassName(const QString &string) const
+{
+ QString result;
+ for (int i=0; i<=string.size(); ++i) {
+ QChar ch;
+ if (i != string.size())
+ ch = string.at(i);
+
+ QChar lower = ch.toLower();
+ if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) ||
+ ch.digitValue() >= 0 ||
+ ch == QLatin1Char('_') ||
+ ch == QLatin1Char(':')) {
+ result += ch;
+ }
+ else if (!result.isEmpty()) {
+ if (result != QLatin1String("const"))
+ return result;
+ result.clear();
+ }
+ }
+ return result;
+}
/*!
Returns a string representing the access specifier.
@@ -426,6 +454,9 @@ void InnerNode::setOverload(const FunctionNode *func, bool overlode)
}
/*!
+ Mark all child nodes that have no documentation as having
+ private access and internal status. qdoc will then ignore
+ them for documentation purposes.
*/
void InnerNode::makeUndocumentedChildrenInternal()
{
@@ -831,6 +862,7 @@ NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
/*!
\class ClassNode
+ \brief This class represents a C++ class.
*/
/*!
@@ -850,8 +882,8 @@ void ClassNode::addBaseClass(Access access,
ClassNode *node,
const QString &dataTypeWithTemplateArgs)
{
- bas.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
- node->der.append(RelatedClass(access, this));
+ bases.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
+ node->derived.append(RelatedClass(access, this));
}
/*!
@@ -859,16 +891,16 @@ void ClassNode::addBaseClass(Access access,
void ClassNode::fixBaseClasses()
{
int i;
-
i = 0;
- while (i < bas.size()) {
- ClassNode *baseClass = bas.at(i).node;
- if (baseClass->access() == Node::Private) {
- bas.removeAt(i);
-
- const QList<RelatedClass> &basesBases = baseClass->baseClasses();
- for (int j = basesBases.size() - 1; j >= 0; --j)
- bas.insert(i, basesBases.at(j));
+ while (i < bases.size()) {
+ ClassNode* bc = bases.at(i).node;
+ if (bc->access() == Node::Private) {
+ RelatedClass rc = bases.at(i);
+ bases.removeAt(i);
+ ignoredBases.append(rc);
+ const QList<RelatedClass> &bb = bc->baseClasses();
+ for (int j = bb.size() - 1; j >= 0; --j)
+ bases.insert(i, bb.at(j));
}
else {
++i;
@@ -876,15 +908,13 @@ void ClassNode::fixBaseClasses()
}
i = 0;
- while (i < der.size()) {
- ClassNode *derivedClass = der.at(i).node;
- if (derivedClass->access() == Node::Private) {
- der.removeAt(i);
-
- const QList<RelatedClass> &dersDers =
- derivedClass->derivedClasses();
- for (int j = dersDers.size() - 1; j >= 0; --j)
- der.insert(i, dersDers.at(j));
+ while (i < derived.size()) {
+ ClassNode* dc = derived.at(i).node;
+ if (dc->access() == Node::Private) {
+ derived.removeAt(i);
+ const QList<RelatedClass> &dd = dc->derivedClasses();
+ for (int j = dd.size() - 1; j >= 0; --j)
+ derived.insert(i, dd.at(j));
}
else {
++i;
@@ -893,6 +923,16 @@ void ClassNode::fixBaseClasses()
}
/*!
+ Search the child list to find the property node with the
+ specified \a name.
+ */
+const PropertyNode* ClassNode::findPropertyNode(const QString& name) const
+{
+ const Node* n = findNode(name,Node::Property);
+ return (n ? static_cast<const PropertyNode*>(n) : 0);
+}
+
+/*!
\class FakeNode
*/
@@ -1567,6 +1607,144 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue)
return defaultValue;
}
}
+
+static QString valueType(const QString& n)
+{
+ if (n == "QPoint")
+ return "QDeclarativePointValueType";
+ if (n == "QPointF")
+ return "QDeclarativePointFValueType";
+ if (n == "QSize")
+ return "QDeclarativeSizeValueType";
+ if (n == "QSizeF")
+ return "QDeclarativeSizeFValueType";
+ if (n == "QRect")
+ return "QDeclarativeRectValueType";
+ if (n == "QRectF")
+ return "QDeclarativeRectFValueType";
+ if (n == "QVector2D")
+ return "QDeclarativeVector2DValueType";
+ if (n == "QVector3D")
+ return "QDeclarativeVector3DValueType";
+ if (n == "QVector4D")
+ return "QDeclarativeVector4DValueType";
+ if (n == "QQuaternion")
+ return "QDeclarativeQuaternionValueType";
+ if (n == "QMatrix4x4")
+ return "QDeclarativeMatrix4x4ValueType";
+ if (n == "QEasingCurve")
+ return "QDeclarativeEasingValueType";
+ if (n == "QFont")
+ return "QDeclarativeFontValueType";
+ return QString();
+}
+
+/*!
+ Returns true if a QML property or attached property is
+ read-only. The algorithm for figuring this out is long
+ amd tedious and almost certainly will break. It currently
+ doesn't work for qmlproperty bool PropertyChanges::explicit,
+ because the tokenized gets confused on "explicit" .
+ */
+bool QmlPropertyNode::isWritable(const Tree* tree) const
+{
+ Node* n = parent();
+ while (n && n->subType() != Node::QmlClass)
+ n = n->parent();
+ if (n) {
+ const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
+ const ClassNode* cn = qcn->classNode();
+ if (cn) {
+ QStringList dotSplit = name().split(QChar('.'));
+ const PropertyNode* pn = cn->findPropertyNode(dotSplit[0]);
+ if (pn) {
+ if (dotSplit.size() > 1) {
+ QStringList path(extractClassName(pn->qualifiedDataType()));
+ const Node* nn = tree->findNode(path,Class);
+ if (nn) {
+ const ClassNode* cn = static_cast<const ClassNode*>(nn);
+ pn = cn->findPropertyNode(dotSplit[1]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ else {
+ const QList<RelatedClass>& bases = cn->baseClasses();
+ if (!bases.isEmpty()) {
+ for (int i=0; i<bases.size(); ++i) {
+ const ClassNode* cn = bases[i].node;
+ pn = cn->findPropertyNode(dotSplit[1]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
+ if (!ignoredBases.isEmpty()) {
+ for (int i=0; i<ignoredBases.size(); ++i) {
+ const ClassNode* cn = ignoredBases[i].node;
+ pn = cn->findPropertyNode(dotSplit[1]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ QString vt = valueType(cn->name());
+ if (!vt.isEmpty()) {
+ QStringList path(vt);
+ const Node* vtn = tree->findNode(path,Class);
+ if (vtn) {
+ const ClassNode* cn = static_cast<const ClassNode*>(vtn);
+ pn = cn->findPropertyNode(dotSplit[1]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ }
+ }
+ }
+ else {
+ return pn->isWritable();
+ }
+ }
+ else {
+ const QList<RelatedClass>& bases = cn->baseClasses();
+ if (!bases.isEmpty()) {
+ for (int i=0; i<bases.size(); ++i) {
+ const ClassNode* cn = bases[i].node;
+ pn = cn->findPropertyNode(dotSplit[0]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
+ if (!ignoredBases.isEmpty()) {
+ for (int i=0; i<ignoredBases.size(); ++i) {
+ const ClassNode* cn = ignoredBases[i].node;
+ pn = cn->findPropertyNode(dotSplit[0]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ if (isAttached()) {
+ QString classNameAttached = cn->name() + "Attached";
+ QStringList path(classNameAttached);
+ const Node* nn = tree->findNode(path,Class);
+ const ClassNode* acn = static_cast<const ClassNode*>(nn);
+ pn = acn->findPropertyNode(dotSplit[0]);
+ if (pn) {
+ return pn->isWritable();
+ }
+ }
+ }
+ }
+ }
+ location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name()));
+ return true;
+}
+
#endif
QT_END_NAMESPACE
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index e9f2d74605..3cc0f60cf0 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -193,6 +193,7 @@ class Node
virtual QString fileBase() const;
QUuid guid() const;
QString ditaXmlHref();
+ QString extractClassName(const QString &string) const;
protected:
Node(Type type, InnerNode* parent, const QString& name);
@@ -326,6 +327,8 @@ struct RelatedClass
QString dataTypeWithTemplateArgs;
};
+class PropertyNode;
+
class ClassNode : public InnerNode
{
public:
@@ -337,8 +340,9 @@ class ClassNode : public InnerNode
const QString &dataTypeWithTemplateArgs = "");
void fixBaseClasses();
- const QList<RelatedClass> &baseClasses() const { return bas; }
- const QList<RelatedClass> &derivedClasses() const { return der; }
+ const QList<RelatedClass> &baseClasses() const { return bases; }
+ const QList<RelatedClass> &derivedClasses() const { return derived; }
+ const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases; }
bool hideFromMainList() const { return hidden; }
void setHideFromMainList(bool value) { hidden = value; }
@@ -349,10 +353,12 @@ class ClassNode : public InnerNode
void setQmlElement(const QString& value) { qmlelement = value; }
virtual bool isAbstract() const { return abstract; }
virtual void setAbstract(bool b) { abstract = b; }
+ const PropertyNode* findPropertyNode(const QString& name) const;
private:
- QList<RelatedClass> bas;
- QList<RelatedClass> der;
+ QList<RelatedClass> bases;
+ QList<RelatedClass> derived;
+ QList<RelatedClass> ignoredBases;
bool hidden;
bool abstract;
QString sname;
@@ -436,6 +442,8 @@ class QmlPropGroupNode : public FakeNode
bool att;
};
+class Tree;
+
class QmlPropertyNode : public LeafNode
{
public:
@@ -454,7 +462,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 isWritable() const { return fromTrool(wri,true); }
+ bool isWritable(const Tree* tree) const;
bool isAttached() const { return att; }
virtual bool isQmlNode() const { return true; }
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index 8cc4fd9566..4963b96e33 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -91,4 +91,6 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \
K_DECLARE_PRIVATE \
PHONON_OBJECT \
PHONON_HEIR \
- Q_PRIVATE_PROPERTY
+ Q_PRIVATE_PROPERTY \
+ Q_DECLARE_PRIVATE_D \
+ Q_CLASSINFO
diff --git a/tools/qdoc3/tokenizer.cpp b/tools/qdoc3/tokenizer.cpp
index 7c10de65a6..05ad5ee57d 100644
--- a/tools/qdoc3/tokenizer.cpp
+++ b/tools/qdoc3/tokenizer.cpp
@@ -67,7 +67,11 @@ static const char *kwords[] = {
"private", "protected", "public", "short", "signals", "signed",
"slots", "static", "struct", "template", "typedef", "typename",
"union", "unsigned", "using", "virtual", "void", "volatile",
- "__int64", "Q_OBJECT", "Q_OVERRIDE", "Q_PROPERTY",
+ "__int64",
+ "Q_OBJECT",
+ "Q_OVERRIDE",
+ "Q_PROPERTY",
+ "Q_PRIVATE_PROPERTY",
"Q_DECLARE_SEQUENTIAL_ITERATOR",
"Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR",
"Q_DECLARE_ASSOCIATIVE_ITERATOR",
diff --git a/tools/qdoc3/tokenizer.h b/tools/qdoc3/tokenizer.h
index f55d2ef048..bd359659bc 100644
--- a/tools/qdoc3/tokenizer.h
+++ b/tools/qdoc3/tokenizer.h
@@ -75,7 +75,7 @@ enum { Tok_Eoi, Tok_Ampersand, Tok_Aster, Tok_Caret, Tok_LeftParen,
Tok_static, Tok_struct, Tok_template, Tok_typedef,
Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual,
Tok_void, Tok_volatile, Tok_int64, Tok_Q_OBJECT, Tok_Q_OVERRIDE,
- Tok_Q_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
+ Tok_Q_PROPERTY, Tok_Q_PRIVATE_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR,
Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR,
Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR,
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index d22a09aae0..56e3484b06 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -469,8 +469,9 @@ void Tree::resolveInheritance(NamespaceNode *rootNode)
for (int pass = 0; pass < 2; pass++) {
NodeList::ConstIterator c = rootNode->childNodes().begin();
while (c != rootNode->childNodes().end()) {
- if ((*c)->type() == Node::Class)
+ if ((*c)->type() == Node::Class) {
resolveInheritance(pass, (ClassNode *) *c);
+ }
else if ((*c)->type() == Node::Namespace) {
NamespaceNode *ns = static_cast<NamespaceNode*>(*c);
resolveInheritance(ns);
@@ -542,14 +543,16 @@ void Tree::resolveInheritance(int pass, ClassNode *classe)
while (b != bounds.end()) {
ClassNode *baseClass = (ClassNode*)findNode((*b).basePath,
Node::Class);
- if (!baseClass && (*b).parent)
+ if (!baseClass && (*b).parent) {
baseClass = (ClassNode*)findNode((*b).basePath,
Node::Class,
(*b).parent);
- if (baseClass)
+ }
+ if (baseClass) {
classe->addBaseClass((*b).access,
baseClass,
(*b).dataTypeWithTemplateArgs);
+ }
++b;
}
}