QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
if (qmlClass) {
qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached);
+ qmlPropGroup->setLocation(location());
}
}
if (qmlPropGroup) {
ClassNode *correspondingClass = static_cast<QmlClassNode*>(qmlPropGroup->parent())->classNode();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup,property,type,attached);
+ qmlPropNode->setLocation(location());
+ qmlPropNode->setQPropertyFlag();
const PropertyNode *correspondingProperty = 0;
if (correspondingClass) {
property,
type,
attached);
+ qmlPropNode->setLocation(location());
+ qmlPropNode->setQPropertyFlag();
if (correspondingProperty) {
bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*');
qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable()));
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
*/
bool QmlPropertyNode::isWritable(Tree* tree)
{
- if (readOnly_ != FlagValueDefault) {
+ if (readOnly_ != FlagValueDefault)
return !fromFlagValue(readOnly_, false);
- }
- PropertyNode* pn = correspondingProperty(tree);
- if (pn) {
- return pn->isWritable();
- }
- else {
- location().warning(tr("Can't detect if QML property %1 is read-only; writable assumed.").arg(name()));
- return true;
+ if (qproperty_) {
+ PropertyNode* pn = correspondingProperty(tree);
+ if (pn)
+ return pn->isWritable();
+
+ location().warning(tr("Can't detect if QML property %1::%2::%3 is read-only; "
+ "writable assumed.")
+ .arg(qmlModuleIdentifier()).arg(qmlTypeName()).arg(name()));
}
+ return true;
}
PropertyNode* QmlPropertyNode::correspondingProperty(Tree *tree)
QString guid() const;
QString ditaXmlHref();
QString extractClassName(const QString &string) const;
+ virtual QString qmlTypeName() const { return name_; }
virtual QString qmlModuleName() const { return qmlModuleName_; }
virtual QString qmlModuleVersion() const { return qmlModuleVersionMajor_ + "." + qmlModuleVersionMinor_; }
virtual QString qmlModuleIdentifier() const { return qmlModuleName_ + qmlModuleVersionMajor_; }
virtual ~QmlPropGroupNode() { }
virtual bool isQmlNode() const { return true; }
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
virtual bool isAttached() const { return attached_; }
virtual bool isQmlNode() const { return true; }
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); }
void appendQmlPropNode(QmlPropertyNode* p) { qmlPropNodes_.append(p); }
const NodeList& qmlPropNodes() const { return qmlPropNodes_; }
+ void setQPropertyFlag() { qproperty_ = true; }
private:
QString type_;
FlagValue designable_;
bool isdefault_;
bool attached_;
+ bool qproperty_;
FlagValue readOnly_;
NodeList qmlPropNodes_;
};
(type() == QmlSignalHandler));
}
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
QmlPropArgs qpa;
if (splitQmlPropertyArg(doc, topicsUsed.at(i).args, qpa)) {
QmlPropertyNode* n = new QmlPropertyNode(qpn, qpa.name_, qpa.type_, false);
+ n->setLocation(doc.location());
qpn->appendQmlPropNode(n);
+ n->setReadOnly(qpn->isReadOnly());
+ if (qpn->isDefault())
+ n->setDefault();
}
else
qDebug() << " FAILED TO PARSE QML PROPERTY:"
if (qmlClass) {
QString name = member->name.toString();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlClass, name, type, false);
+ //qmlPropNode->setLocation(doc.location());
qmlPropNode->setReadOnly(member->isReadonlyMember);
if (member->isDefaultMember)
qmlPropNode->setDefault();
applyDocumentation(member->firstSourceLocation(), qmlPropNode);
}
-#if 0
- if (qmlClass) {
- QString name = member->name->asString();
- QmlPropGroupNode *qmlPropGroup = new QmlPropGroupNode(qmlClass, name, false);
- if (member->isDefaultMember)
- qmlPropGroup->setDefault();
- QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup, name, type, false);
- qmlPropNode->setWritable(!member->isReadonlyMember);
- applyDocumentation(member->firstSourceLocation(), qmlPropGroup);
- }
-#endif
}
break;
}