aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qjsvalue_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-01-17 15:23:01 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-02 08:10:24 +0100
commit54c51c89e21800b3a455127b3c19a3c5b30ee319 (patch)
tree9781a998567abf4513919cc08e928a3df03eecbf /src/declarative/qml/v8/qjsvalue_p.h
parented84a6ee63ac7a53f37efad3eb4a7e4eaa047242 (diff)
Remove QJSValue::propertyFlags() function
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 <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue_p.h')
-rw-r--r--src/declarative/qml/v8/qjsvalue_p.h13
1 files changed, 11 insertions, 2 deletions
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<v8::String> name) const;
+ inline PropertyFlags propertyFlags(const QString& name) const;
+ inline PropertyFlags propertyFlags(v8::Handle<v8::String> name) const;
inline QScriptPassPointer<QJSValuePrivate> call(QJSValuePrivate* thisObject, const QJSValueList& args);
inline QScriptPassPointer<QJSValuePrivate> 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