diff options
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 126c6ec..bde8a44 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -151,9 +151,7 @@ private: static bool hasMethodAccess(const QMetaMethod &method, int index, const QScriptEngine::QObjectWrapOptions &opt) { - // FIXME: this is fragile and may break if signals/slots are added to/removed from QObject. - // See QTBUG-23502 - const int deleteLaterIndex = 3; + static const int deleteLaterIndex = QObject::staticMetaObject.indexOfMethod("deleteLater()"); return (method.access() != QMetaMethod::Private) && ((index != deleteLaterIndex) || !(opt & QScriptEngine::ExcludeDeleteLater)) && (!(opt & QScriptEngine::ExcludeSlots) || (method.methodType() != QMetaMethod::Slot)); |