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
qqmlscriptblob_p.h
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#ifndef QQMLSCRIPTBLOB_P_H
5#define QQMLSCRIPTBLOB_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qqmlnotifyingblob_p.h>
19#include <private/qqmlscriptdata_p.h>
20#include <private/qqmltypeloader_p.h>
21
24
25class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlNotifyingBlob
26{
27private:
28 friend class QQmlTypeLoader;
29
30public:
31 enum class IsESModule { No, Yes };
32 QQmlScriptBlob(const QUrl &url, QQmlTypeLoader *typeLoader, IsESModule isESModule);
33 ~QQmlScriptBlob() override;
34
35 struct ScriptReference
36 {
37 QV4::CompiledData::Location location;
38 QString qualifier;
39 QString nameSpace;
40 QQmlRefPointer<QQmlScriptBlob> script;
41 };
42
43 QQmlRefPointer<QQmlScriptData> scriptData() const
44 {
45 return m_scriptData;
46 }
47
48protected:
49 void dataReceived(const SourceCodeData &) override;
50 void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit *unit) override;
51 void done() override;
52
53 QString stringAt(int index) const override;
54
55private:
56 void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &blob, const QV4::CompiledData::Location &location, const QString &qualifier, const QString &nameSpace) override;
57 void initializeFromCompilationUnit(QQmlRefPointer<QV4::CompiledData::CompilationUnit> &&cu);
58
59 QList<ScriptReference> m_scripts;
60 QQmlRefPointer<QQmlScriptData> m_scriptData;
61 const bool m_isModule = false;
62};
63
64QT_END_NAMESPACE
65
66#endif // QQMLSCRIPTBLOB_P_H
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)