summaryrefslogtreecommitdiffstats
path: root/src/script/bridge
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-03 11:21:44 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-03 11:21:44 (GMT)
commitd1cf24277dd736a873c20dd3aebea9d185636a78 (patch)
treefa74d3c09a2bb347923678394fcf780ebfcefedc /src/script/bridge
parent5674aa6122722fec40287bd04d2d1cc1f09554c8 (diff)
downloadQt-d1cf24277dd736a873c20dd3aebea9d185636a78.zip
Qt-d1cf24277dd736a873c20dd3aebea9d185636a78.tar.gz
Qt-d1cf24277dd736a873c20dd3aebea9d185636a78.tar.bz2
make more tests pass
Implement delete operator for Qt properties.
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptqobject.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 8a77018..5565b48 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1310,7 +1310,19 @@ bool QObjectWrapperObject::deleteProperty(JSC::ExecState *exec,
}
}
- int index = qobject->dynamicPropertyNames().indexOf(name);
+ const QScriptEngine::QObjectWrapOptions &opt = data->options;
+ const QMetaObject *meta = qobject->metaObject();
+ int index = meta->indexOfProperty(name);
+ if (index != -1) {
+ QMetaProperty prop = meta->property(index);
+ if (prop.isScriptable() &&
+ (!(opt & QScriptEngine::ExcludeSuperClassProperties)
+ || (index >= meta->propertyOffset()))) {
+ return false;
+ }
+ }
+
+ index = qobject->dynamicPropertyNames().indexOf(name);
if (index != -1) {
(void)qobject->setProperty(name, QVariant());
return true;