summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/script/api/qscriptengine.cpp1
-rw-r--r--src/script/api/qscriptengine.h1
-rw-r--r--src/script/bridge/qscriptqobject.cpp3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 356b4d0..2650d7f 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -292,6 +292,7 @@ QT_BEGIN_NAMESPACE
\value ExcludeSuperClassProperties The script object will not expose properties inherited from the superclass.
\value ExcludeSuperClassContents Shorthand form for ExcludeSuperClassMethods | ExcludeSuperClassProperties
\value ExcludeDeleteLater The script object will not expose the QObject::deleteLater() slot.
+ \value ExcludeSlots The script object will not expose the QObject's slots.
\value AutoCreateDynamicProperties Properties that don't already exist in the QObject will be created as dynamic properties of that object, rather than as properties of the script object.
\value PreferExistingWrapperObject If a wrapper object with the requested configuration already exists, return that object.
\value SkipMethodsInEnumeration Don't include methods (signals and slots) when enumerating the object's properties.
diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h
index 2ce3183..76461bc 100644
--- a/src/script/api/qscriptengine.h
+++ b/src/script/api/qscriptengine.h
@@ -125,6 +125,7 @@ public:
ExcludeSuperClassContents = 0x0006,
SkipMethodsInEnumeration = 0x0008,
ExcludeDeleteLater = 0x0010,
+ ExcludeSlots = 0x0020,
AutoCreateDynamicProperties = 0x0100,
PreferExistingWrapperObject = 0x0200
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 765e074..83a811b 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -151,7 +151,8 @@ private:
static bool hasMethodAccess(const QMetaMethod &method, int index, const QScriptEngine::QObjectWrapOptions &opt)
{
return (method.access() != QMetaMethod::Private)
- && ((index != 2) || !(opt & QScriptEngine::ExcludeDeleteLater));
+ && ((index != 2) || !(opt & QScriptEngine::ExcludeDeleteLater))
+ && (!(opt & QScriptEngine::ExcludeSlots) || (method.methodType() != QMetaMethod::Slot));
}
static bool isEnumerableMetaProperty(const QMetaProperty &prop,