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// Qt-Security score:significant
4
6
8
9void QQmlTypeNameCache::add(const QHashedString &name, const QUrl &url, const QHashedString &nameSpace)
10{
11 if (nameSpace.size() != 0) {
12 QQmlImportRef *i = m_namedImports.value(nameSpace);
13 Q_ASSERT(i != nullptr);
14 i->compositeSingletons.insert(name, url);
15 return;
16 }
17
18 if (m_anonymousCompositeSingletons.contains(name))
19 return;
20
21 m_anonymousCompositeSingletons.insert(name, url);
22}
23
24void QQmlTypeNameCache::add(const QHashedString &name, int importedScriptIndex, const QHashedString &nameSpace)
25{
26 QQmlImportRef import;
27 import.scriptIndex = importedScriptIndex;
28 import.m_qualifier = name;
29
30 if (nameSpace.size() != 0) {
31 QQmlImportRef *i = m_namedImports.value(nameSpace);
32 Q_ASSERT(i != nullptr);
33 m_namespacedImports[i].insert(name, import);
34 return;
35 }
36
37 if (m_namedImports.contains(name))
38 return;
39
40 m_namedImports.insert(name, import);
41}
42
43QT_END_NAMESPACE
Combined button and popup list for selecting options.