summaryrefslogtreecommitdiffstats
path: root/src/script/bridge
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-12-17 01:21:18 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-12-17 02:04:40 (GMT)
commitba55b1fee6d7f1d7d669e291fd0e0db17b6c40ed (patch)
treebcf3cb557547b632aaecf519bc61930625b0f0a2 /src/script/bridge
parent11075eb489347418e317731cf169fad31cf47ea5 (diff)
downloadQt-ba55b1fee6d7f1d7d669e291fd0e0db17b6c40ed.zip
Qt-ba55b1fee6d7f1d7d669e291fd0e0db17b6c40ed.tar.gz
Qt-ba55b1fee6d7f1d7d669e291fd0e0db17b6c40ed.tar.bz2
Correctly determine QScriptValue::isQObject() for QObjects using the
QScriptDeclarativeClass. This allows us to pass QObjects to QML-defined functions which expect a QVariant (and will presumably help in other cases where we expect transparent QObject <-> QVariant conversion in the engine). Task-number: QTBUG-6178 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp5
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index 98b3e26..2c13066 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -320,6 +320,11 @@ QStringList QScriptDeclarativeClass::propertyNames(Object *object)
return QStringList();
}
+bool QScriptDeclarativeClass::isQObject() const
+{
+ return false;
+}
+
QObject *QScriptDeclarativeClass::toQObject(Object *, bool *ok)
{
if (ok) *ok = false;
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 40e5051..f2557bd 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -97,6 +97,7 @@ public:
virtual QStringList propertyNames(Object *);
+ virtual bool isQObject() const;
virtual QObject *toQObject(Object *, bool *ok = 0);
virtual QVariant toVariant(Object *, bool *ok = 0);