aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/ambiguous.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-04-01 14:21:02 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-04-01 20:58:49 +0200
commitc12f0f07f577d4a2c58fd139d0ca0b7aac39fda9 (patch)
tree688ff7b944812515959785a46628b62046489efc /tests/auto/qml/qmlcppcodegen/data/ambiguous.h
parent3827b7039df47e756bdee7ebe4e5bb481cad081d (diff)
QmlCompiler: Improve ambiguous type detection
When detecting an ambiguous type, we need to invalidate the entry in the list of types, rather than delete it. If we delete it and we get yet another version of the type, we'll add that one just like it was not ambiguous. Furthermore, we cannot check the type name when looking for ambiguity. The QML name can be bent and twisted in various ways, to import ambiguous-looking types under different names, so that they are actually not ambiguous. Pick-to: 6.2 6.3 Fixes: QTBUG-102153 Change-Id: Iee7951229c5f68b168899e55164e8cf91587eec1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/ambiguous.h')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/ambiguous.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/ambiguous.h b/tests/auto/qml/qmlcppcodegen/data/ambiguous.h
new file mode 100644
index 0000000000..4ec36fb0df
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/ambiguous.h
@@ -0,0 +1,20 @@
+#ifndef AMBIGUOUS_H
+#define AMBIGUOUS_H
+
+#include <QtCore/qobject.h>
+#include <QtQmlIntegration/qqmlintegration.h>
+
+class Ambiguous : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+ QML_ADDED_IN_VERSION(1, 2)
+
+public:
+ Ambiguous(QObject *parent = nullptr) : QObject(parent)
+ {
+ setObjectName(QStringLiteral("Ambiguous"));
+ }
+};
+
+#endif // AMBIGUOUS_H