aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/multiforeign.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/multiforeign.h')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/multiforeign.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/multiforeign.h b/tests/auto/qml/qmlcppcodegen/data/multiforeign.h
new file mode 100644
index 0000000000..290b6370f5
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/multiforeign.h
@@ -0,0 +1,51 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef MULTIFOREIGN_H
+#define MULTIFOREIGN_H
+
+#include <QtCore/qobject.h>
+#include <QtQml/qqml.h>
+
+class Autochthon : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString location READ location WRITE setLocation NOTIFY locationChanged FINAL)
+
+public:
+ const QString &location() const
+ {
+ return m_location;
+ }
+
+ void setLocation(const QString &newLocation)
+ {
+ if (m_location == newLocation)
+ return;
+ m_location = newLocation;
+ emit locationChanged();
+ }
+
+signals:
+ void locationChanged();
+
+private:
+ QString m_location;
+};
+
+struct Foreign1
+{
+ Q_GADGET
+ QML_FOREIGN(Autochthon)
+ QML_ELEMENT
+};
+
+struct Foreign2
+{
+ Q_GADGET
+ QML_FOREIGN(Autochthon)
+ QML_ELEMENT
+};
+
+
+#endif // MULTIFOREIGN_H