16#include <private/qqmldirparser_p.h>
17#include <private/qqmlboundsignal_p.h>
18#include <private/qqmljsdiagnosticmessage_p.h>
19#include <private/qqmltype_p_p.h>
20#include <private/qqmlpluginimporter_p.h>
21#include <QtCore/qstandardpaths.h>
22#include <QtCore/qmetaobject.h>
24#include <QtCore/qcoreapplication.h>
25#include <QtCore/qcryptographichash.h>
26#include <QtCore/qdir.h>
27#include <QtCore/qmutex.h>
28#include <QtCore/qthread.h>
29#include <private/qthread_p.h>
30#include <private/qqmlscriptdata_p.h>
31#include <QtQml/private/qqmlcomponentattached_p.h>
32#include <QtQml/private/qqmlsourcecoordinate_p.h>
33#include <QtQml/private/qqmlcomponent_p.h>
35#if QT_CONFIG(qml_network)
37#include <QNetworkAccessManager>
40#include <private/qobject_p.h>
41#include <private/qmetaobject_p.h>
42#if QT_CONFIG(qml_locale)
43#include <private/qqmllocale_p.h>
45#include <private/qqmlbind_p.h>
46#include <private/qqmlconnections_p.h>
47#if QT_CONFIG(qml_animation)
48#include <private/qqmltimer_p.h>
50#include <private/qqmlplatform_p.h>
51#include <private/qqmlloggingcategory_p.h>
52#include <private/qv4sequenceobject_p.h>
59# define CSIDL_APPDATA 0x001a
122bool QQmlEnginePrivate::s_designerMode =
false;
126 return s_designerMode;
131 s_designerMode =
true;
189QQmlImageProviderBase::QQmlImageProviderBase()
201 qWarning() << QQmlEngine::tr(
"There are still \"%1\" items in the process of being created at engine destruction.").arg(
inProgressCreations);
208#if QT_CONFIG(qml_debug)
220 lc = lc->linkedContext()) {
222 if (lc->contextObject() ==
o)
223 lc->setContextObject(
nullptr);
225 d->ownContext->invalidate();
226 if (
d->ownContext->contextObject() ==
o)
227 d->ownContext->setContextObject(
nullptr);
228 d->ownContext.reset();
229 d->context =
nullptr;
232 if (
d->outerContext &&
d->outerContext->contextObject() ==
o)
233 d->outerContext->setContextObject(
nullptr);
235 if (
d->hasVMEMetaObject ||
d->hasInterceptorMetaObject) {
249 d->hasVMEMetaObject =
d->hasInterceptorMetaObject =
false;
259 : ownMemory(ownership == OwnsMemory), indestructible(true), explicitIndestructibleSet(
false),
260 hasTaintedV4Object(
false), isQueuedForDeletion(
false), rootObjectInCreation(
false),
261 hasInterceptorMetaObject(
false), hasVMEMetaObject(
false), hasConstWrapper(
false), dummy(0),
262 bindingBitsArraySize(InlineBindingArraySize)
293 if (ep) QQmlNotifier::emitNotify(ep,
a);
317 if (!objectThreadData->thread.loadAcquire())
323 auto ev = std::make_unique<QMetaCallEvent>(
m.methodIndex(), 0,
nullptr,
325 parameterTypes.
size() + 1);
327 void **
args = ev->args();
330 for (
int ii = 0; ii < parameterTypes.
size(); ++ii) {
337 if (!
types[ii + 1].isValid()) {
338 qWarning(
"QObject::connect: Cannot queue arguments of type '%s'\n"
339 "(Make sure '%s' is registered using qRegisterMetaType().)",
344 args[ii + 1] =
types[ii + 1].create(
a[ii + 1]);
349 mpo->
moveToThread(objectThreadData->thread.loadAcquire());
354 if (ep) QQmlNotifier::emitNotify(ep,
a);
389 auto currentObject = workStack.
last();
393 for (
QObject *
child: std::as_const(currentObjectPriv->children))
402 if (ddata->ownContext) {
403 Q_ASSERT(ddata->ownContext.data() == ddata->context);
404 ddata->context->emitDestruction();
405 if (ddata->ownContext->contextObject() ==
object)
406 ddata->ownContext->setContextObject(
nullptr);
407 ddata->ownContext.reset();
408 ddata->context =
nullptr;
410 ddata->isQueuedForDeletion =
true;
417 ddata->disconnectNotifiers();
428 while (
b && (
b->targetPropertyIndex().coreIndex() != coreIndex ||
429 b->targetPropertyIndex().hasValueTypeIndex()))
432 if (
b &&
b->targetPropertyIndex().coreIndex() == coreIndex &&
433 !
b->targetPropertyIndex().hasValueTypeIndex())
480 const int varId = qmlRegisterType<QVariant>(
"QML", 1, 0,
"var");
482 qmlRegisterAnonymousSequentialContainer<QList<QVariant>>(
"QML", 1);
484 qmlRegisterType<QObject>(
"QML", 1, 0,
"QtObject");
485 qmlRegisterType<QQmlComponent>(
"QML", 1, 0,
"Component");
487 qmlRegisterType<int>(
"QML", 1, 0,
"int");
488 qmlRegisterAnonymousSequentialContainer<QList<int>>(
"QML", 1);
490 const int realId = qmlRegisterType<double>(
"QML", 1, 0,
"real");
492 qmlRegisterAnonymousSequentialContainer<QList<double>>(
"QML", 1);
494 qmlRegisterType<QString>(
"QML", 1, 0,
"string");
495 qmlRegisterAnonymousSequentialContainer<QList<QString>>(
"QML", 1);
497 qmlRegisterType<bool>(
"QML", 1, 0,
"bool");
498 qmlRegisterAnonymousSequentialContainer<QList<bool>>(
"QML", 1);
500 qmlRegisterType<QDateTime>(
"QML", 1, 0,
"date");
501 qmlRegisterAnonymousSequentialContainer<QList<QDateTime>>(
"QML", 1);
503 qmlRegisterType<QUrl>(
"QML", 1, 0,
"url");
504 qmlRegisterAnonymousSequentialContainer<QList<QUrl>>(
"QML", 1);
506#if QT_CONFIG(regularexpression)
507 qmlRegisterType<QRegularExpression>(
"QML", 1, 0,
"regexp");
508 qmlRegisterAnonymousSequentialContainer<QList<QRegularExpression>>(
"QML", 1);
514 qmlRegisterAnonymousType<std::nullptr_t>(
"QML", 1);
515 qmlRegisterAnonymousType<QVariantMap>(
"QML", 1);
517 qmlRegisterAnonymousType<QJSValue>(
"QML", 1);
518 qmlRegisterAnonymousSequentialContainer<QList<QJSValue>>(
"QML", 1);
520 qmlRegisterAnonymousType<qint8>(
"QML", 1);
521 qmlRegisterAnonymousSequentialContainer<QList<qint8>>(
"QML", 1);
523 qmlRegisterAnonymousType<quint8>(
"QML", 1);
524 qmlRegisterAnonymousSequentialContainer<QList<quint8>>(
"QML", 1);
526 qmlRegisterAnonymousType<short>(
"QML", 1);
527 qmlRegisterAnonymousSequentialContainer<QList<short>>(
"QML", 1);
529 qmlRegisterAnonymousType<ushort>(
"QML", 1);
530 qmlRegisterAnonymousSequentialContainer<QList<ushort>>(
"QML", 1);
532 qmlRegisterAnonymousType<uint>(
"QML", 1);
533 qmlRegisterAnonymousSequentialContainer<QList<uint>>(
"QML", 1);
535 qmlRegisterAnonymousType<qlonglong>(
"QML", 1);
536 qmlRegisterAnonymousSequentialContainer<QList<qlonglong>>(
"QML", 1);
538 qmlRegisterAnonymousType<qulonglong>(
"QML", 1);
539 qmlRegisterAnonymousSequentialContainer<QList<qulonglong>>(
"QML", 1);
541 qmlRegisterAnonymousType<float>(
"QML", 1);
542 qmlRegisterAnonymousSequentialContainer<QList<float>>(
"QML", 1);
544 qmlRegisterAnonymousType<QChar>(
"QML", 1);
545 qmlRegisterAnonymousSequentialContainer<QList<QChar>>(
"QML", 1);
547 qmlRegisterAnonymousType<QDate>(
"QML", 1);
548 qmlRegisterAnonymousSequentialContainer<QList<QDate>>(
"QML", 1);
550 qmlRegisterAnonymousType<QTime>(
"QML", 1);
551 qmlRegisterAnonymousSequentialContainer<QList<QTime>>(
"QML", 1);
553 qmlRegisterAnonymousType<QByteArray>(
"QML", 1);
554 qmlRegisterAnonymousSequentialContainer<QList<QByteArray>>(
"QML", 1);
557 static_assert(std::is_same_v<QStringList, QList<QString>>);
558 static_assert(std::is_same_v<QVariantList, QList<QVariant>>);
560 qRegisterMetaType<QQmlScriptString>();
561 qRegisterMetaType<QQmlComponent::Status>();
562 qRegisterMetaType<QList<QObject*> >();
563 qRegisterMetaType<QQmlBinding*>();
569 q->handle()->setQmlEngine(
q);
649 d->singletonInstances.clear();
651 delete d->rootContext;
652 d->rootContext =
nullptr;
654 d->typeLoader.invalidate();
706 d->typeLoader.lock();
707 d->typeLoader.clearCache();
708 d->typeLoader.unlock();
726 d->typeLoader.trimCache();
747 d->singletonInstances.clear();
764 return d->rootContext;
767#if QT_DEPRECATED_SINCE(6, 0)
779 return d->urlInterceptors.last();
795 d->urlInterceptors.append(urlInterceptor);
809 d->urlInterceptors.removeOne(urlInterceptor);
831 return d->urlInterceptors;
841#if QT_CONFIG(qml_network)
854void QQmlEngine::setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *
factory)
858 d->networkAccessManagerFactory =
factory;
866QQmlNetworkAccessManagerFactory *QQmlEngine::networkAccessManagerFactory()
const
869 return d->networkAccessManagerFactory;
876 if (networkAccessManagerFactory) {
877 nam = networkAccessManagerFactory->create(
parent);
888 if (!networkAccessManager)
889 networkAccessManager = createNetworkAccessManager(
const_cast<QQmlEngine*
>(
q));
890 return networkAccessManager;
908 return d->getNetworkAccessManager();
933 d->imageProviders.insert(std::move(providerIdLower), std::move(
sp));
946 return d->imageProviders.value(providerIdLower).data();
959 d->imageProviders.take(providerIdLower);
975 if (
d->baseUrl.isEmpty()) {
1004 return d->outputWarningsToMsgLog;
1020 d->outputWarningsToMsgLog =
enabled;
1058 if (
auto propertyCapture =
d->propertyCapture)
1059 propertyCapture->captureTranslation();
1070 if (
d->propertyCapture && !
property.isConstant()) {
1071 d->propertyCapture->captureProperty(
1128 if (!
type.isValid() || !
type.isSingleton())
1162 auto loadHelper = QQml::makeRefPointer<LoadHelper>(&
d->typeLoader, uri);
1164 auto [moduleStatus,
type] = loadHelper->resolveType(
typeName);
1168 if (!
type.isValid())
1170 if (!
type.isSingleton())
1188 d->translationLanguage.notify();
1208 return data->outerContext->asQQmlContext();
1227 if (
data->context) {
1228 qWarning(
"QQmlEngine::setContextForObject(): Object already has a QQmlContext");
1234 data->context = contextData.
data();
1235 contextData->addOwnedObject(
data);
1270 endpoint->prev =
nullptr;
1272 while (endpoint->next) {
1274 endpoint = endpoint->next;
1280 int index = endpoint->sourceSignal;
1284 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1294 Q_ASSERT(maximumTodoIndex >= notifiesSize);
1300 const int memsetSize = (maximumTodoIndex - notifiesSize + 1) *
1302 memset(notifies + notifiesSize, 0, memsetSize);
1304 if (notifies != old) {
1305 for (
int ii = 0; ii < notifiesSize; ++ii)
1307 notifies[ii]->prev = ¬ifies[ii];
1310 notifiesSize = maximumTodoIndex + 1;
1315 maximumTodoIndex = 0;
1371 if (index < notifyList->notifiesSize) {
1374 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1382 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1432 while (signalHandler) {
1447 if (
source.size() > 100) {
1455 qFatal(
"Object %p destroyed while one of its QML signal handlers is in progress.\n"
1456 "Most likely the object was deleted synchronously (use QObject::deleteLater() "
1457 "instead), or the application is running a nested event loop.\n"
1458 "This behavior is NOT supported!\n"
1463 signalHandler->m_prevSignal =
nullptr;
1464 signalHandler->m_nextSignal =
nullptr;
1465 delete signalHandler;
1466 signalHandler =
next;
1480 if (guard->objectDestroyed)
1481 guard->objectDestroyed(guard);
1487 delete extendedData;
1540 if (
q->receivers(
SIGNAL(quit())) == 0) {
1541 qWarning(
"Signal QQmlEngine::quit() emitted, but no receivers connected to handle it.");
1548 if (
q->receivers(
SIGNAL(exit(
int))) == 0)
1549 qWarning(
"Signal QQmlEngine::exit() emitted, but no receivers connected to handle it.");
1550 emit q->exit(retCode);
1555 switch (
error.messageType()) {
1558 error.line(),
nullptr).
debug().noquote().nospace()
1559 <<
error.toString();
1563 error.line(),
nullptr).
info().noquote().nospace()
1564 <<
error.toString();
1570 <<
error.toString();
1575 <<
error.toString();
1582 for (
int ii = 0; ii < errors.
size(); ++ii)
1590 if (outputWarningsToMsgLog)
1597 emit q->warnings(errors);
1598 if (outputWarningsToMsgLog)
1639 if (
m.isWarning()) {
1646 error.setDescription(
m.message);
1654void QQmlEnginePrivate::cleanupScarceResources()
1663 engine->scarceResources.remove(sr);
1686 d->importDatabase.addImportPath(
path);
1707 return d->importDatabase.importPathList();
1725 d->importDatabase.setImportPathList(
paths);
1743 d->importDatabase.addPluginPath(
path);
1758 return d->importDatabase.pluginPathList();
1774 d->importDatabase.setPluginPathList(
paths);
1777#if QT_CONFIG(library)
1778#if QT_DEPRECATED_SINCE(6, 4)
1798 uri,
QTypeRevision(), &
d->importDatabase, &qmldir, &
d->typeLoader, errors);
1799 return importer.importDynamicPlugin(filePath, uri,
false).isValid();
1832 if (
dir ==
d->offlineStoragePath)
1834 d->offlineStoragePath =
dir;
1835 Q_EMIT offlineStoragePathChanged();
1842 if (
d->offlineStoragePath.isEmpty()) {
1845 if (!dataLocation.
isEmpty()) {
1849 Q_EMIT e->q_func()->offlineStoragePathChanged();
1853 return d->offlineStoragePath;
1883 if (!
value.isUndefined()) {
1892 if (
value.isQObject()) {
1898 singletonInstances.convertAndInsert(v4engine(),
type, &
value);
1905 error.setDescription(
QString::asprintf(
"qmlRegisterSingletonType(): \"%s\" is not available because the callback function returns a null pointer.",
1909 type.createProxy(
o);
1919 if (!
data->context) {
1921 data->context = contextData.data();
1922 contextData->addOwnedObject(
data);
1927 singletonInstances.convertAndInsert(v4engine(),
type, &
value);
1938 singletonInstances.convertAndInsert(v4engine(),
type, &
value);
1947 return typeLoader.isTypeLoaded(
url);
1952 return typeLoader.isScriptLoaded(
url);
1959 const auto unit = compilationUnitFromUrl(
url);
1962 executeRuntimeFunction(unit, functionIndex, thisObject, argc,
args,
types);
1970 Q_ASSERT((functionIndex >= 0) && (functionIndex < unit->runtimeFunctions.size()));
1991 if (
auto nested =
function->nestedFunction()) {
1994 }
else if (
function->isClosureWrapper()) {
2016 auto unit = typeLoader.getType(
url)->compilationUnit();
2027 int subComponentIndex,
bool isComponentRoot)
2037 if (isComponentRoot && unit->dependentScripts.size()) {
2045 for (
int i = 0;
i < unit->dependentScripts.size(); ++
i) {
2047 scripts->put(
i, (
v =
s->scriptValueForContext(
context)));
2054#if defined(Q_OS_WIN)
2061 const LPCTSTR nameC =
reinterpret_cast<LPCTSTR
>(nativeSeparatorName.utf16());
2064#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
2066 if (FAILED(SHParseDisplayName(nameC, NULL,
reinterpret_cast<LPITEMIDLIST
>(&
file), 0, NULL)))
2069 PIDLIST_ABSOLUTE
file;
2070 if (FAILED(SHParseDisplayName(nameC, NULL, &
file, 0, NULL)))
2074 bool gotPath = SHGetPathFromIDList(
file,
buffer);
2083 canonicalName[0] = canonicalName.
at(0).
toUpper();
2090#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
2094#if defined(Q_OS_DARWIN)
2096#elif defined(Q_OS_WIN)
2100 const QString canonical = shellNormalizeFileName(absolute);
2103 const int absoluteLength = absolute.
length();
2104 const int canonicalLength = canonical.
length();
2106 int length =
qMin(absoluteLength, canonicalLength);
2107 if (lengthIn >= 0) {
2115 if (lastSlash >= 0) {
2116 const int fileNameLength = absoluteLength - 1 - lastSlash;
2121 for (
int ii = 0; ii <
length; ++ii) {
2122 const QChar &
a = absolute.
at(absoluteLength - 1 - ii);
2123 const QChar &
c = canonical.
at(canonicalLength - 1 - ii);
2125 if (
a.toLower() !=
c.toLower())
2165 , m_uri(uri.toString())
2168 auto import = std::make_shared<PendingImport>();
2169 import->uri = m_uri;
2171 if (!Blob::addImport(
import, &errorList)) {
2180 if (!couldFindModule())
2199bool LoadHelper::couldFindModule()
const
2204 if (import->priority == 0)
2211#include "moc_qqmlengine_p.cpp"
2213#include "moc_qqmlengine.cpp"
static bool(* isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int)
static int(* receivers)(QAbstractDeclarativeData *, const QObject *, int)
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
static void(* signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **)
Type loadRelaxed() const noexcept
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
QChar toUpper() const noexcept
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
void addData(QByteArrayView data) noexcept
Adds the characters in bytes to the cryptographic hash.
QByteArray result() const
Returns the final hash value.
static QChar separator()
Returns the native directory separator: "/" under Unix and "\\" under Windows.
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
static QString toNativeSeparators(const QString &pathName)
static QString currentPath()
Returns the absolute path of the application's current directory.
static QString rootPath()
Returns the absolute path of the root directory.
\inmodule QtCore \reentrant
QString absoluteFilePath() const
Returns an absolute path including the file name.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
T value(const Key &key) const noexcept
static void addToDebugServer(QJSEngine *q)
static void removeFromDebugServer(QJSEngine *q)
The QJSEngine class provides an environment for evaluating JavaScript code.
The QJSValue class acts as a container for Qt/JavaScript data types.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void void Q_DECL_COLD_FUNCTION void warning(const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2
Logs a warning message specified with format msg.
void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void critical(const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2
Logs a critical message specified with format msg.
void void void info(const QLoggingCategory &cat, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3
Logs an informational message specified with format msg for the context cat.
void debug(const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2
Logs a debug message specified with format msg.
The QNetworkAccessManager class allows the application to send network requests and receive replies.
static QObjectPrivate * get(QObject *o)
QAtomicPointer< QThreadData > threadData
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
QQmlAbstractBinding * nextBinding() const
void setAddedToObject(bool v)
virtual void setEnabled(bool e, QQmlPropertyData::WriteFlags f=QQmlPropertyData::DontRemoveBinding)=0
DataType
Specifies where URL interception is taking place.
QString expression() const
QQmlBoundSignalExpression * expression() const
Returns the signal expression.
The QQmlComponent class encapsulates a QML component definition.
void setOwnedObjects(QQmlData *ownedObjects)
void setInternal(bool isInternal)
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
QQmlData * ownedObjects() const
void initFromTypeCompilationUnit(const QQmlRefPointer< QV4::ExecutableCompilationUnit > &unit, int subComponentIndex)
void setImportedScripts(const QV4::PersistentValue &scripts)
void setImports(const QQmlRefPointer< QQmlTypeNameCache > &imports)
static QQmlRefPointer< QQmlContextData > createRefCounted(const QQmlRefPointer< QQmlContextData > &parent)
static QQmlContextPrivate * get(QQmlContext *context)
The QQmlContext class defines a context within a QML engine.
QList< QQmlError > errors() const
Return the errors on this blob.
Type type() const
Returns the type provided to the constructor.
QHash< QQmlAttachedPropertiesFunc, QObject * > attachedProperties
QHash< QQmlAttachedPropertiesFunc, QObject * > * attachedProperties() const
static void flushPendingBinding(QObject *object, int coreIndex)
static void markAsDeleted(QObject *)
static QQmlPropertyCache::ConstPtr ensurePropertyCache(QObject *object)
QQmlNotifierEndpoint * notify(int index)
QVector< DeferredData * > deferredData
QQmlRefPointer< QV4::ExecutableCompilationUnit > compilationUnit
void addNotify(int index, QQmlNotifierEndpoint *)
QQmlPropertyCache::ConstPtr propertyCache
QQmlData(Ownership ownership)
bool signalHasEndpoint(int index) const
QQmlRefPointer< QQmlContextData > ownContext
void disconnectNotifiers()
void releaseDeferredData()
BindingBitsType bindingBitsValue[InlineBindingArraySize]
static void destroyed(QAbstractDeclarativeData *, QObject *)
QQmlBoundSignal * signalHandlers
QQmlContextData * context
QQmlData ** prevContextObject
BindingBitsType * bindingBits
quint32 bindingBitsArraySize
void clearPendingBindingBit(int)
static QQmlData * get(QObjectPrivate *priv, bool create)
void deferData(int objectIndex, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &, const QQmlRefPointer< QQmlContextData > &)
int endpointCount(int index)
QQmlData * nextContextObject
static void setQueuedForDeletion(QObject *)
QQmlContextData * outerContext
QQmlAbstractBinding * bindings
static void activateDesignerMode()
QHash< QString, QSharedPointer< QQmlImageProviderBase > > imageProviders
QMutex networkAccessManagerMutex
QSharedPointer< QQmlImageProviderBase > imageProvider(const QString &providerId) const
QV4::ExecutableCompilationUnit * compilationUnitFromUrl(const QUrl &url)
static std::atomic< bool > qml_debugging_enabled
\qmltype QtObject \instantiates QObject \inqmlmodule QtQml
void sendExit(int retCode=0)
void warning(const QQmlError &)
void executeRuntimeFunction(const QUrl &url, qsizetype functionIndex, QObject *thisObject, int argc=0, void **args=nullptr, QMetaType *types=nullptr)
static bool baseModulesUninitialized
static QList< QQmlError > qmlErrorFromDiagnostics(const QString &fileName, const QList< QQmlJS::DiagnosticMessage > &diagnosticMessages)
~QQmlEnginePrivate() override
bool isTypeLoaded(const QUrl &url) const
static QQmlEnginePrivate * get(QQmlEngine *e)
QQmlContext * rootContext
QString offlineStorageDatabaseDirectory() const
bool isScriptLoaded(const QUrl &url) const
QQmlIncubationController * incubationController
static const quintptr profiler
QRecursiveMutex imageProviderMutex
static bool designerMode()
QQmlRefPointer< QQmlContextData > createInternalContext(const QQmlRefPointer< QV4::ExecutableCompilationUnit > &unit, const QQmlRefPointer< QQmlContextData > &parentContext, int subComponentIndex, bool isComponentRoot)
The QQmlEngine class provides an environment for instantiating QML components.
static QQmlContext * contextForObject(const QObject *)
Returns the QQmlContext for the object, or nullptr if no context has been set.
void addPluginPath(const QString &dir)
Adds path as a directory where the engine searches for native plugins for imported modules (reference...
void removeUrlInterceptor(QQmlAbstractUrlInterceptor *urlInterceptor)
Remove a urlInterceptor that was previously added using \l addUrlInterceptor.
QQmlEngine(QObject *p=nullptr)
Create a new QQmlEngine with the given parent.
void setImportPathList(const QStringList &paths)
Sets paths as the list of directories where the engine searches for installed modules in a URL-based ...
QStringList importPathList() const
Returns the list of directories where the engine searches for installed modules in a URL-based direct...
QList< QQmlAbstractUrlInterceptor * > urlInterceptors() const
Returns the list of currently active URL interceptors.
bool outputWarningsToStandardError() const
Returns true if warning messages will be output to stderr in addition to being emitted by the warning...
static void setContextForObject(QObject *, QQmlContext *)
Sets the QQmlContext for the object to context.
void addUrlInterceptor(QQmlAbstractUrlInterceptor *urlInterceptor)
Adds a urlInterceptor to be used when resolving URLs in QML.
void setOfflineStoragePath(const QString &dir)
QQmlImageProviderBase * imageProvider(const QString &id) const
Returns the image provider set for providerId if found; otherwise returns \nullptr.
QQmlContext * rootContext() const
Returns the engine's root context.
QUrl baseUrl() const
Return the base URL for this engine.
void captureProperty(QObject *object, const QMetaProperty &property) const
QString offlineStoragePath
the directory for storing offline user data
bool event(QEvent *) override
\reimp
void setOutputWarningsToStandardError(bool)
Set whether warning messages will be output to stderr to enabled.
void trimComponentCache()
Trims the engine's internal component cache.
QStringList pluginPathList() const
Returns the list of directories where the engine searches for native plugins for imported modules (re...
void setPluginPathList(const QStringList &paths)
Sets the list of directories where the engine searches for native plugins for imported modules (refer...
void clearSingletons()
Clears all singletons the engine owns.
void setBaseUrl(const QUrl &)
Set the base URL for this engine to url.
void addImportPath(const QString &dir)
Adds path as a directory where the engine searches for installed modules in a URL-based directory str...
void markCurrentFunctionAsTranslationBinding()
QString offlineStorageDatabaseFilePath(const QString &databaseName) const
Returns the file path where a \l{QtQuick.LocalStorage}{Local Storage} database with the identifier da...
void clearComponentCache()
Clears the engine's internal component cache.
void addImageProvider(const QString &id, QQmlImageProviderBase *)
Sets the provider to use for images requested via the image: url scheme, with host providerId.
QUrl interceptUrl(const QUrl &url, QQmlAbstractUrlInterceptor::DataType type) const
Run the current URL interceptors on the given url of the given type and return the result.
void retranslate()
Refreshes all binding expressions that use strings marked for translation.
~QQmlEngine() override
Destroys the QQmlEngine.
void removeImageProvider(const QString &id)
Removes the image provider for providerId.
The QQmlError class encapsulates a QML error.
void setObject(QObject *g)
The QQmlImageProviderBase class is used to register image providers in the QML engine.
virtual ~QQmlImageProviderBase()
bool resolveType(const QHashedStringRef &type, QQmlType *type_return, QTypeRevision *version_return, QQmlImportNamespace **ns_return, QList< QQmlError > *errors=nullptr, QQmlType::RegistrationType registrationType=QQmlType::AnyRegistrationType, bool *typeRecursionDetected=nullptr) const
virtual QQmlSourceLocation sourceLocation() const
bool isNotifying() const
Returns true if a notify is in progress.
int qt_metacall(QMetaObject::Call, int methodIndex, void **a) override
QPointer< QObject > target
QVector< PendingImportPtr > m_unresolvedImports
QQmlRefPointer< QQmlImports > m_importCache
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
QQmlType type(const QHashedStringRef &name, QTypeRevision version) const
static QString writableLocation(StandardLocation type)
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString & replace(qsizetype i, qsizetype len, QChar after)
void truncate(qsizetype pos)
Truncates the string at the given position index.
qsizetype size() const
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toLower() const &
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QString & append(QChar c)
QByteArray toUtf8() const &
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
qsizetype length() const
Returns the number of characters in this string.
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a val...
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
const CompiledObject * objectAt(int index) const
QVector< QV4::Function * > runtimeFunctions
QVector< BindingPropertyData > bindingPropertyDataPerObject
QV4::Function * linkToEngine(QV4::ExecutionEngine *engine)
void push_back(const T &t)
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
void Q_QML_EXPORT qdeclarativeelement_destructor(QObject *)
int Q_QML_EXPORT qmlregister(RegistrationType, void *)
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLenum GLenum * types
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLsizei const GLuint * paths
GLenum GLuint GLsizei const GLenum * props
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
static qreal component(const QPointF &point, unsigned int i)
int qmlTypeId(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
static void dumpwarning(const QQmlError &error)
void hasJsOwnershipIndicator(QQmlGuardImpl *)
bool QQml_isFileCaseCorrect(const QString &fileName, int lengthIn)
Returns true if the case of fileName is equivalent to the file case of fileName on disk,...
int qmlRegisterType< void >(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
const QLoggingCategory & lcQmlImport()
int qmlConvertSourceCoordinate< quint32, int >(quint32 n)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
unsigned long long quint64
if(qFloatDistance(a, b)<(1<< 7))
[0]
QFileInfo info(fileName)
[8]
QUrl url("example.com")
[constructor-url-reference]
QItemEditorFactory * factory
LoadHelper(QQmlTypeLoader *loader, QAnyStringView uri)
ResolveTypeResult resolveType(QAnyStringView typeName)
\inmodule QtCore \reentrant
QQmlNotifierEndpoint ** notifies
QQmlNotifierEndpoint * todo
std::function< QObject *(QQmlEngine *, QJSEngine *)> qobjectCallback
std::function< QJSValue(QQmlEngine *, QJSEngine *)> scriptCallback
bool hasFlag(Flag flag) const
const Binding * bindingTable() const
ExecutionContext * scriptContext() const
Heap::ArrayObject * newArrayObject(int count=0)
void callInContext(QV4::Function *function, QObject *self, QV4::ExecutionContext *ctxt, int argc, void **args, QMetaType *types)
static Heap::QmlContext * create(QV4::ExecutionContext *parent, QQmlRefPointer< QQmlContextData > context, QObject *scopeObject)
QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent