diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-03 11:21:44 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-03 11:21:44 (GMT) |
commit | d1cf24277dd736a873c20dd3aebea9d185636a78 (patch) | |
tree | fa74d3c09a2bb347923678394fcf780ebfcefedc /src/script/bridge | |
parent | 5674aa6122722fec40287bd04d2d1cc1f09554c8 (diff) | |
download | Qt-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.cpp | 14 |
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; |