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/qproperty.h>
43#include <QtCore/qstack.h>
44#include <QtCore/qstring.h>
45#include <QtCore/qthread.h>
55class QQmlNetworkAccessManagerFactory;
127#if !QT_CONFIG(qml_debug)
133 bool outputWarningsToMsgLog =
true;
137 int inProgressCreations = 0;
141#if QT_CONFIG(qml_worker_script)
142 QThread *workerScriptEngine =
nullptr;
148#if QT_CONFIG(qml_network)
152 mutable QQmlNetworkAccessManagerFactory *networkAccessManagerFactory =
nullptr;
160 int scarceResourcesRefCount = 0;
161 void referenceScarceResources();
162 void dereferenceScarceResources();
175 unsigned int incubatorCount = 0;
180 QString offlineStorageDatabaseDirectory()
const;
182 bool isTypeLoaded(
const QUrl &
url)
const;
183 bool isScriptLoaded(
const QUrl &
url)
const;
185 template <
typename T>
189 void sendExit(
int retCode = 0);
207 static bool designerMode();
208 static void activateDesignerMode();
216 int typeIndex =
type.id();
217 auto it = cachedValueTypeInstances.
find(typeIndex);
218 if (
it != cachedValueTypeInstances.
end())
223 cachedValueTypeInstances.insert(typeIndex, instance);
233 QObject *thisObject,
int argc = 0,
void **
args =
nullptr,
239 int subComponentIndex,
bool isComponentRoot);
250 context->installContext(ddata, kind);
255 class SingletonInstances :
private QHash<QQmlType, QJSValue>
266 const auto canDelete = [](
QObject *instance,
const auto &
type) ->
bool {
270 if (!
type.singletonInstanceInfo()->url.isEmpty())
274 return !(ddata && ddata->indestructible && ddata->explicitIndestructibleSet);
277 for (
auto it = constBegin(),
end = constEnd();
it !=
end; ++
it) {
278 auto *instance =
it.value().toQObject();
279 if (canDelete(instance,
it.key()))
283 for (
auto it = constBegin(),
end = constEnd();
it !=
end; ++
it) {
284 QObject *instance =
it.value().toQObject();
286 if (canDelete(instance,
it.key()))
297 SingletonInstances singletonInstances;
300 static bool s_designerMode;
302 void cleanupScarceResources();
330 cleanupScarceResources();
353 return e ?
e->d_func() :
nullptr;
356template<
typename Context>
396 return qobject_cast<T>(singletonInstance<QJSValue>(
type).toQObject());
416 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.
The QIntrusiveList class is a template class that provides a list of objects using static storage.
static QJSEnginePrivate * get(QJSEngine *e)
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
static std::atomic< bool > qml_debugging_enabled
\qmltype QtObject \instantiates QObject \inqmlmodule QtQml
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.
iterator find(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble q
QQmlEngine * qmlEngine(const QObject *obj)
QQmlEnginePrivate * contextEngine(const Context &context)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QML_FOREIGN(FOREIGN_TYPE)
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
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 *)
TriggerList(QQmlJavaScriptExpression *expression)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent