aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypewrapper.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2013-11-13 11:03:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-14 08:03:55 +0100
commit1df8a42e5b7fc718121dc92dd7203046d25015e0 (patch)
tree140b430265e1f92d70236e792d08e92356a016c8 /src/qml/qml/qqmltypewrapper.cpp
parent3afffa47feabc80e1bc20ffd2143a722a1c360a2 (diff)
Allow passing qmlRegisterSingletonType QObjects to C++ as QObject*
At the moment you can pass them as their FinalType* or as one of their ParentType* but not as QObject* which does not make much sense to me Task-number: QTBUG-34617 Task-number: QTBUG-30730 Change-Id: Id5cfb7bbb123456ef43f44f33b450f8966a7641a Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmltypewrapper.cpp')
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index f309d69136..3fd39754e5 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -69,6 +69,11 @@ QmlTypeWrapper::~QmlTypeWrapper()
typeNamespace->release();
}
+bool QmlTypeWrapper::isSingleton() const
+{
+ return type && type->isSingleton();
+}
+
QVariant QmlTypeWrapper::toVariant() const
{
if (type && type->isSingleton()) {