20#include <private/qfieldlist_p.h>
21#include <private/qintrusivelist_p.h>
22#include <private/qjsengine_p.h>
23#include <private/qjsvalue_p.h>
24#include <private/qpodvector_p.h>
25#include <private/qqmldirparser_p.h>
26#include <private/qqmlimport_p.h>
27#include <private/qqmlmetatype_p.h>
28#include <private/qqmlnotifier_p.h>
29#include <private/qqmlproperty_p.h>
30#include <private/qqmltypeloader_p.h>
31#include <private/qqmlvaluetype_p.h>
32#include <private/qrecyclepool_p.h>
33#include <private/qv4engine_p.h>
35#include <QtQml/qqml.h>
36#include <QtQml/qqmlcontext.h>
38#include <QtCore/qlist.h>
39#include <QtCore/qmetaobject.h>
40#include <QtCore/qmutex.h>
41#include <QtCore/qpair.h>
42#include <QtCore/qpointer.h>
43#include <QtCore/qproperty.h>
44#include <QtCore/qstack.h>
45#include <QtCore/qstring.h>
46#include <QtCore/qthread.h>
56class QQmlNetworkAccessManagerFactory;
120#if !QT_CONFIG(qml_debug)
126 bool outputWarningsToMsgLog =
true;
130 int inProgressCreations = 0;
134#if QT_CONFIG(qml_worker_script)
135 QThread *workerScriptEngine =
nullptr;
141#if QT_CONFIG(qml_network)
145 mutable QQmlNetworkAccessManagerFactory *networkAccessManagerFactory =
nullptr;
149 QSharedPointer<QQmlImageProviderBase> imageProvider(
const QString &providerId)
const;
153 int scarceResourcesRefCount = 0;
154 void referenceScarceResources();
155 void dereferenceScarceResources();
168 unsigned int incubatorCount = 0;
170 void incubate(
QQmlIncubator &,
const QQmlRefPointer<QQmlContextData> &);
173 QString offlineStorageDatabaseDirectory()
const;
175 bool isTypeLoaded(
const QUrl &
url)
const;
176 bool isScriptLoaded(
const QUrl &
url)
const;
178 template <
typename T>
182 void sendExit(
int retCode = 0);
184 void warning(
const QList<QQmlError> &);
198 static QList<QQmlError> qmlErrorFromDiagnostics(
const QString &
fileName,
const QList<QQmlJS::DiagnosticMessage> &diagnosticMessages);
200 static bool designerMode();
201 static void activateDesignerMode();
203 static std::atomic<bool> qml_debugging_enabled;
209 int typeIndex =
type.id();
210 auto it = cachedValueTypeInstances.
constFind(typeIndex);
211 if (
it != cachedValueTypeInstances.
cend())
216 cachedValueTypeInstances.insert(typeIndex, instance);
226 QObject *thisObject,
int argc = 0,
void **
args =
nullptr,
229 QQmlRefPointer<QQmlContextData>
230 createInternalContext(
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &unit,
231 const QQmlRefPointer<QQmlContextData> &parentContext,
232 int subComponentIndex,
bool isComponentRoot);
243 context->installContext(ddata, kind);
248 class SingletonInstances :
private QHash<QQmlType::SingletonInstanceInfo::ConstPtr, QJSValue>
251 void convertAndInsert(
261 const auto canDelete = [](
QObject *instance,
const auto &siinfo) ->
bool {
265 if (!siinfo->url.isEmpty())
269 return !(ddata && ddata->indestructible && ddata->explicitIndestructibleSet);
272 for (
auto it = constBegin(),
end = constEnd();
it !=
end; ++
it) {
273 auto *instance =
it.value().toQObject();
274 if (canDelete(instance,
it.key()))
278 for (
auto it = constBegin(),
end = constEnd();
it !=
end; ++
it) {
279 QObject *instance =
it.value().toQObject();
281 if (canDelete(instance,
it.key()))
292 SingletonInstances singletonInstances;
293 QHash<int, QQmlGadgetPtrWrapper *> cachedValueTypeInstances;
295 static bool s_designerMode;
297 void cleanupScarceResources();
325 cleanupScarceResources();
348 return e ? e->d_func() :
nullptr;
351template<
typename Context>
391 return qobject_cast<T>(singletonInstance<QJSValue>(
type).toQObject());
411 bool couldFindModule()
const;
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
QV4::ExecutionEngine * handle() const
static void manageStringOnV4Heap(QV4::ExecutionEngine *e, QJSValue *jsval)
The QJSValue class acts as a container for Qt/JavaScript data types.
The QNetworkAccessManager class allows the application to send network requests and receive replies.
The QQmlContext class defines a context within a QML engine.
static void markAsDeleted(QObject *)
static QQmlData * get(QObjectPrivate *priv, bool create)
QHash< QString, QSharedPointer< QQmlImageProviderBase > > imageProviders
Q_OBJECT_BINDABLE_PROPERTY(QQmlEnginePrivate, QString, translationLanguage)
QMutex networkAccessManagerMutex
QRecyclePool< QQmlJavaScriptExpressionGuard > jsExpressionGuardPool
QQmlTypeLoader typeLoader
QQmlGadgetPtrWrapper * valueTypeInstance(QMetaType type)
int scarceResourcesRefCount
QIntrusiveList< Incubator, &Incubator::next > incubatorList
static bool baseModulesUninitialized
QQmlEnginePrivate(QQmlEngine *q)
static QQmlEnginePrivate * get(QQmlEngine *e)
void referenceScarceResources()
QV4::ExecutionEngine * v4engine() const
void dereferenceScarceResources()
QRecyclePool< TriggerList > qPropertyTriggerPool
QQmlImportDatabase importDatabase
static void setInternalContext(QObject *This, const QQmlRefPointer< QQmlContextData > &context, QQmlContextData::QmlObjectKind kind)
QString offlineStoragePath
T singletonInstance(const QQmlType &type)
QRecursiveMutex imageProviderMutex
QList< QQmlAbstractUrlInterceptor * > urlInterceptors
static QV4::ExecutionEngine * getV4Engine(QQmlEngine *e)
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlError class encapsulates a QML error.
The QQmlImportDatabase class manages the QML imports for a QQmlEngine.
QQmlIncubationController instances drive the progress of QQmlIncubators.
The QQmlIncubator class allows QML objects to be created asynchronously.
QQmlJavaScriptExpressionGuard * next
static QQmlJavaScriptExpressionGuard * New(QQmlJavaScriptExpression *e, QQmlEngine *engine)
QQmlJavaScriptExpression * expression
@ QQmlJavaScriptExpressionGuard
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
const_iterator cend() const noexcept
const_iterator constFind(const T &value) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble q
QQmlEngine * qmlEngine(const QObject *obj)
QQmlEnginePrivate * contextEngine(const Context &context)
QDebug warning(QAnyStringView fileName, int lineNumber)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QUrl url("example.com")
[constructor-url-reference]
enum LoadHelper::ResolveTypeResult::Status status
LoadHelper(QQmlTypeLoader *loader, QAnyStringView uri)
ResolveTypeResult resolveType(QAnyStringView typeName)
void dataReceived(const SourceCodeData &) final
Invoked when data for the blob is received.
void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit *) final
QPointer< QObject > target
QQmlJavaScriptExpression * m_expression
QMetaProperty property() const
static void trigger(QPropertyObserver *, QUntypedPropertyData *)
QQmlRefPointer< const SingletonInstanceInfo > ConstPtr
QQmlEngine * qmlEngine() const
TriggerList(QQmlJavaScriptExpression *expression)