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
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
4#include <private/qqmldirdata_p.h>
5
7
8QQmlQmldirData::QQmlQmldirData(const QUrl &url, QQmlTypeLoader *loader)
9 : QQmlTypeLoader::Blob(url, QmldirFile, loader)
10{
11}
12
14{
15 return m_content;
16}
17
19{
20 auto it = m_imports.constFind(blob);
21 if (it == m_imports.constEnd())
23 return it->import->location;
24}
25
27 QQmlTypeLoader::Blob::PendingImportPtr import, int priority)
28{
29 m_imports.insert(blob, { std::move(import), priority });
30}
31
33{
35 m_content = data.readAll(&error);
36 if (!error.isEmpty()) {
38 return;
39 }
40}
41
46
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
Definition qhash.h:1925
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition qhash.h:2034
const_iterator constFind(const Key &key) const noexcept
Definition qhash.h:2025
void setError(const QQmlError &)
Mark this blob as having errors.
void dataReceived(const SourceCodeData &) override
Invoked when data for the blob is received.
QV4::CompiledData::Location importLocation(Blob *blob) const
void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit *) override
const QString & content() const
void setPriority(Blob *, PendingImportPtr, int)
std::shared_ptr< PendingImport > PendingImportPtr
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
QSet< QString >::iterator it
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_UNIMPLEMENTED()
QUrl url("example.com")
[constructor-url-reference]