aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltyperegistrar
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-09-17 11:41:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-09-20 17:45:23 +0200
commit88aea5173f5bb7d900a4a3220ba44a2632262624 (patch)
treedb5d49d9b97ea1d931ce72dd3e3020a352a425a2 /tests/auto/qml/qmltyperegistrar
parent4a00d59473d9b6d2daa7b1aaf1ace0e432ee9f9c (diff)
qmltyperegistrar: Strip '*' from method return types
Method return types should look the same as other types. Also, recognize that method return types could be lists and add a TODO to this effect. Pick-to: 6.2 Fixes: QTBUG-96587 Change-Id: I94bbc347fc47eba8f09dc40a9163cfe78aec4b94 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Diffstat (limited to 'tests/auto/qml/qmltyperegistrar')
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp7
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
index 6d6dcd0895..ef642ed984 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
@@ -326,4 +326,11 @@ void tst_qmltyperegistrar::derivedFromForeignPrivate()
QVERIFY(qmltypesData.contains("file: \"private/foreign_p.h\""));
}
+void tst_qmltyperegistrar::methodReturnType()
+{
+ QVERIFY(qmltypesData.contains("createAThing"));
+ QVERIFY(!qmltypesData.contains("QQmlComponent*"));
+ QVERIFY(qmltypesData.contains("type: \"QQmlComponent\""));
+}
+
QTEST_MAIN(tst_qmltyperegistrar)
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
index e144c26499..62f22af420 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
@@ -33,6 +33,7 @@
#include "foreign_p.h"
#include <QtQml/qqml.h>
+#include <QtQml/qqmlcomponent.h>
#include <QtCore/qproperty.h>
#include <QtCore/qtimeline.h>
#include <QtCore/qrect.h>
@@ -431,6 +432,14 @@ class DerivedFromForeignPrivate : public ForeignPrivate
QML_ELEMENT
};
+class WithMethod : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+public:
+ Q_INVOKABLE QQmlComponent *createAThing(int) { return nullptr; }
+};
+
class tst_qmltyperegistrar : public QObject
{
Q_OBJECT
@@ -463,6 +472,7 @@ private slots:
void namespaceExtendedNamespace();
void deferredNames();
void derivedFromForeignPrivate();
+ void methodReturnType();
private:
QByteArray qmltypesData;