aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/testtypes.h
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 /tests/auto/qml/qqmlecmascript/testtypes.h
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 'tests/auto/qml/qqmlecmascript/testtypes.h')
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index 52a619637c..6dcef2dc6e 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -291,6 +291,16 @@ Q_DECLARE_METATYPE(QQmlListProperty<MyQmlObject>)
QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES)
+class MyInheritedQmlObject : public MyQmlObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE bool isItYouQObject(QObject *o);
+ Q_INVOKABLE bool isItYouMyQmlObject(MyQmlObject *o);
+ Q_INVOKABLE bool isItYouMyInheritedQmlObject(MyInheritedQmlObject *o);
+};
+QML_DECLARE_TYPE(MyInheritedQmlObject)
+
class MyQmlContainer : public QObject
{
Q_OBJECT