From 54c51c89e21800b3a455127b3c19a3c5b30ee319 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 17 Jan 2012 15:23:01 +0100 Subject: Remove QJSValue::propertyFlags() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rationale: The API is incomplete. There is no way to set/update the flags; adding a third (optional) argument to setProperty() is ugly. If necessary, a QJSPropertyDescriptor API should be added, to enable complete setting/querying of properties. The flags were moved to QJSValuePrivate, and the propertyFlags() implementation kept, because there is one place the read-only flag is checked internally (in qv8typewrapper). Task-number: QTBUG-23604 Change-Id: I089dce28dbda428662aac7c8d1536987fe6d855c Reviewed-by: Jędrzej Nowacki --- src/declarative/qml/v8/qjsvalue_p.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/declarative/qml/v8/qjsvalue_p.h') diff --git a/src/declarative/qml/v8/qjsvalue_p.h b/src/declarative/qml/v8/qjsvalue_p.h index 02ffc8108e..3eccba64bd 100644 --- a/src/declarative/qml/v8/qjsvalue_p.h +++ b/src/declarative/qml/v8/qjsvalue_p.h @@ -59,6 +59,13 @@ class QJSValuePrivate : public QSharedData { public: + enum PropertyFlag { + ReadOnly = 0x00000001, + Undeletable = 0x00000002, + SkipInEnumeration = 0x00000004 + }; + Q_DECLARE_FLAGS(PropertyFlags, PropertyFlag) + inline static QJSValuePrivate* get(const QJSValue& q); inline static QJSValue get(const QJSValuePrivate* d); inline static QJSValue get(QJSValuePrivate* d); @@ -125,8 +132,8 @@ public: inline bool deleteProperty(const QString& name); inline bool hasProperty(const QString &name) const; inline bool hasOwnProperty(const QString &name) const; - inline QJSValue::PropertyFlags propertyFlags(const QString& name) const; - inline QJSValue::PropertyFlags propertyFlags(v8::Handle name) const; + inline PropertyFlags propertyFlags(const QString& name) const; + inline PropertyFlags propertyFlags(v8::Handle name) const; inline QScriptPassPointer call(QJSValuePrivate* thisObject, const QJSValueList& args); inline QScriptPassPointer call(QJSValuePrivate* thisObject, const QJSValue& arguments); @@ -181,6 +188,8 @@ private: friend class QV8Engine; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QJSValuePrivate::PropertyFlags) + QT_END_NAMESPACE #endif -- cgit v1.2.3