Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmltypenamecache.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
7
8void QQmlTypeNameCache::add(const QHashedString &name, const QUrl &url, const QHashedString &nameSpace)
9{
10 if (nameSpace.size() != 0) {
11 QQmlImportRef *i = m_namedImports.value(nameSpace);
12 Q_ASSERT(i != nullptr);
13 i->compositeSingletons.insert(name, url);
14 return;
15 }
16
17 if (m_anonymousCompositeSingletons.contains(name))
18 return;
19
20 m_anonymousCompositeSingletons.insert(name, url);
21}
22
23void QQmlTypeNameCache::add(const QHashedString &name, int importedScriptIndex, const QHashedString &nameSpace)
24{
25 QQmlImportRef import;
26 import.scriptIndex = importedScriptIndex;
27 import.m_qualifier = name;
28
29 if (nameSpace.size() != 0) {
30 QQmlImportRef *i = m_namedImports.value(nameSpace);
31 Q_ASSERT(i != nullptr);
32 m_namespacedImports[i].insert(name, import);
33 return;
34 }
35
36 if (m_namedImports.contains(name))
37 return;
38
39 m_namedImports.insert(name, import);
40}
41
42QT_END_NAMESPACE