aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-02-01 16:14:47 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-02-08 00:18:08 +0100
commit0af12845a4ae16fecb5107ca73ab046ea5fa5693 (patch)
treecc61c9420bc58399adfd72e227fdb3f4caaa5c37 /src/qml/qml/qqmlmetatype_p.h
parent2c6383bd8d907cbcc631e651fdb4d7aa1a3c75e0 (diff)
QtQml: Do not speculatively create ICs for non-composite types
This just clobbers the type registry with useless trash. Pick-to: 6.7 6.6 Task-number: QTBUG-120506 Change-Id: I9c56930493cfbe343359f6cb22eac2a6c76d01a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index bb592dfa07..3c2b893499 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -101,10 +101,14 @@ public:
static QQmlType typeForUrl(const QString &urlString, const QHashedStringRef& typeName,
CompositeTypeLookupMode mode, QList<QQmlError> *errors,
QTypeRevision version = QTypeRevision());
- static QQmlType inlineComponentTypeForUrl(const QUrl &url);
- static QQmlType inlineComponentTypeForUrl(const QUrl &baseUrl, const QString &name)
+
+ static QQmlType fetchOrCreateInlineComponentTypeForUrl(const QUrl &url);
+ static QQmlType inlineComponentType(const QQmlType &outerType, const QString &name)
{
- return inlineComponentTypeForUrl(inlineComponentUrl(baseUrl, name));
+ return outerType.isComposite()
+ ? fetchOrCreateInlineComponentTypeForUrl(
+ inlineComponentUrl(outerType.sourceUrl(), name))
+ : QQmlType();
}
static void unregisterType(int type);