diff options
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; |