aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativescript.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-26 15:04:58 +0100
committerQt by Nokia <qt-info@nokia.com>2011-10-26 18:38:40 +0200
commitb79ceabb43427ba73fb0d64bd24f46c44e6a9d8d (patch)
treec15e0907029d996cbee83735c3e5bd382ee2a6f9 /src/declarative/qml/qdeclarativescript.cpp
parenta927dc97844fd23e295387f8174367f3f4be2977 (diff)
Readonly QML property support
Task-number: QTBUG-15257 Change-Id: I539b6e6a9e0e0172b68e8002aaa3f7c7e6648769 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativescript.cpp')
-rw-r--r--src/declarative/qml/qdeclarativescript.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/declarative/qml/qdeclarativescript.cpp b/src/declarative/qml/qdeclarativescript.cpp
index fb4f26a781..9d18cb3889 100644
--- a/src/declarative/qml/qdeclarativescript.cpp
+++ b/src/declarative/qml/qdeclarativescript.cpp
@@ -182,7 +182,7 @@ Property *QDeclarativeScript::Object::getProperty(const QString &name, bool crea
}
QDeclarativeScript::Object::DynamicProperty::DynamicProperty()
-: isDefaultProperty(false), type(Variant), defaultValue(0), nextProperty(0),
+: isDefaultProperty(false), isReadOnly(false), type(Variant), defaultValue(0), nextProperty(0),
resolvedCustomTypeName(0)
{
}
@@ -225,8 +225,8 @@ int QDeclarativeScript::Object::DynamicSlot::parameterNamesLength() const
QDeclarativeScript::Property::Property()
: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false),
- isValueTypeSubProperty(false), isAlias(false), scriptStringScope(-1),
- nextMainProperty(0), nextProperty(0)
+ isValueTypeSubProperty(false), isAlias(false), isReadOnlyDeclaration(false),
+ scriptStringScope(-1), nextMainProperty(0), nextProperty(0)
{
}
@@ -1028,18 +1028,9 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
return false;
}
- if (node->isReadonlyMember) {
- QDeclarativeError error;
- error.setDescription(QCoreApplication::translate("QDeclarativeParser","Readonly not yet supported"));
- error.setLine(node->readonlyToken.startLine);
- error.setColumn(node->readonlyToken.startColumn);
- _parser->_errors << error;
- return false;
-
- }
-
Object::DynamicProperty *property = _parser->_pool.New<Object::DynamicProperty>();
property->isDefaultProperty = node->isDefaultMember;
+ property->isReadOnly = node->isReadonlyMember;
property->type = type;
if (type >= Object::DynamicProperty::Custom) {
QDeclarativeScript::TypeReference *typeRef =