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
qqmldirdata.cpp
Go to the documentation of this file.
1
// Copyright (C) 2019 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
5
#
include
<
private
/
qqmldirdata_p
.
h
>
6
7
QT_BEGIN_NAMESPACE
8
9
QQmlQmldirData::QQmlQmldirData(
const
QUrl &url, QQmlTypeLoader *loader)
10
: QQmlTypeLoader::Blob(url, QmldirFile, loader)
11
{
12
}
13
14
const
QString &QQmlQmldirData::content()
const
15
{
16
return
m_content;
17
}
18
19
QV4::CompiledData::Location QQmlQmldirData::importLocation(QQmlTypeLoader::Blob *blob)
const
20
{
21
auto
it = m_imports.constFind(blob);
22
if
(it == m_imports.constEnd())
23
return
QV4::CompiledData::Location();
24
return
it->import->location;
25
}
26
27
void
QQmlQmldirData::setPriority(
28
QQmlTypeLoader::Blob *blob,
const
QQmlTypeLoader::Blob::PendingImportPtr &import,
29
int
priority)
30
{
31
assertTypeLoaderThread();
32
m_imports.insert(blob, { import, priority });
33
}
34
35
void
QQmlQmldirData::dataReceived(
const
SourceCodeData &data)
36
{
37
assertTypeLoaderThread();
38
QString error;
39
m_content = data.readAll(&error);
40
if
(!error.isEmpty()) {
41
setError(error);
42
return
;
43
}
44
}
45
46
void
QQmlQmldirData::initializeFromCachedUnit(
const
QQmlPrivate::CachedQmlUnit *)
47
{
48
assertTypeLoaderThread();
49
Q_UNIMPLEMENTED();
50
}
51
52
QT_END_NAMESPACE
qtdeclarative
src
qml
qml
qqmldirdata.cpp
Generated on
for Qt by
1.16.1