Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
43
iterator insert(const Key &key, const T &value)
Definition qmap.h:688
void add(const QHashedString &name, int sciptIndex=-1, const QHashedString &nameSpace=QHashedString())
bool contains(const K &) const
void insert(const K &, const T &)
T * value(const K &) const
qsizetype size() const noexcept
Returns the number of characters in this string.
Definition qstring.h:186
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
GLuint name
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QUrl url("example.com")
[constructor-url-reference]