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
124bool QQmlEnginePrivate::s_designerMode =
false;
128 return s_designerMode;
133 s_designerMode =
true;
191QQmlImageProviderBase::QQmlImageProviderBase()
203 qWarning() << QQmlEngine::tr(
"There are still \"%1\" items in the process of being created at engine destruction.").arg(
inProgressCreations);
210#if QT_CONFIG(qml_debug)
222 d->ownContext->deepClearContextObject(
o, invalidate, invalidate);
223 d->ownContext.reset();
224 d->context =
nullptr;
225 Q_ASSERT(!
d->outerContext ||
d->outerContext->contextObject() !=
o);
226 }
else if (
d->outerContext &&
d->outerContext->contextObject() ==
o) {
227 d->outerContext->deepClearContextObject(
o, invalidate, invalidate);
230 if (
d->hasVMEMetaObject ||
d->hasInterceptorMetaObject) {
244 d->hasVMEMetaObject =
d->hasInterceptorMetaObject =
false;
254 : ownMemory(ownership == OwnsMemory), indestructible(true), explicitIndestructibleSet(
false),
255 hasTaintedV4Object(
false), isQueuedForDeletion(
false), rootObjectInCreation(
false),
256 hasInterceptorMetaObject(
false), hasVMEMetaObject(
false), hasConstWrapper(
false), dummy(0),
257 bindingBitsArraySize(InlineBindingArraySize)
288 if (ep) QQmlNotifier::emitNotify(ep,
a);
310 if (!ddata->notifyList.loadRelaxed())
315 if (!objectThreadData->thread.loadAcquire())
319 QList<QByteArray> parameterTypes =
m.parameterTypes();
321 auto ev = std::make_unique<QMetaCallEvent>(
m.methodIndex(), 0,
nullptr,
323 parameterTypes.size() + 1);
325 void **
args = ev->args();
328 for (
int ii = 0; ii < parameterTypes.size(); ++ii) {
335 if (!
types[ii + 1].isValid()) {
336 qWarning(
"QObject::connect: Cannot queue arguments of type '%s'\n"
337 "(Make sure '%s' is registered using qRegisterMetaType().)",
342 args[ii + 1] =
types[ii + 1].create(
a[ii + 1]);
347 mpo->
moveToThread(objectThreadData->thread.loadAcquire());
352 if (ep) QQmlNotifier::emitNotify(ep,
a);
384 QVarLengthArray<QObject *> workStack;
385 workStack.push_back(
o);
386 while (!workStack.isEmpty()) {
387 auto currentObject = workStack.last();
388 workStack.pop_back();
391 for (
QObject *
child: std::as_const(currentObjectPriv->children))
392 workStack.push_back(
child);
400 if (ddata->ownContext) {
401 Q_ASSERT(ddata->ownContext.data() == ddata->context);
402 ddata->ownContext->deepClearContextObject(
object);
403 ddata->ownContext.reset();
404 ddata->context =
nullptr;
406 ddata->isQueuedForDeletion =
true;
424 while (
b && (
b->targetPropertyIndex().coreIndex() != coreIndex ||
425 b->targetPropertyIndex().hasValueTypeIndex()))
428 if (
b &&
b->targetPropertyIndex().coreIndex() == coreIndex &&
429 !
b->targetPropertyIndex().hasValueTypeIndex())
477 static_assert(std::is_same_v<QStringList, QList<QString>>);
478 static_assert(std::is_same_v<QVariantList, QList<QVariant>>);
480 qRegisterMetaType<QQmlScriptString>();
481 qRegisterMetaType<QQmlComponent::Status>();
482 qRegisterMetaType<QList<QObject*> >();
483 qRegisterMetaType<QQmlBinding*>();
492 q->handle()->setQmlEngine(
q);
560 d->singletonInstances.clear();
562 delete d->rootContext;
563 d->rootContext =
nullptr;
565 d->typeLoader.invalidate();
627 d->typeLoader.lock();
628 d->typeLoader.clearCache();
629 d->typeLoader.unlock();
649 d->typeLoader.trimCache();
670 d->singletonInstances.clear();
687 return d->rootContext;
690#if QT_DEPRECATED_SINCE(6, 0)
702 return d->urlInterceptors.last();
718 d->urlInterceptors.append(urlInterceptor);
732 d->urlInterceptors.removeOne(urlInterceptor);
754 return d->urlInterceptors;
764#if QT_CONFIG(qml_network)
777void QQmlEngine::setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *
factory)
781 d->networkAccessManagerFactory =
factory;
789QQmlNetworkAccessManagerFactory *QQmlEngine::networkAccessManagerFactory()
const
792 return d->networkAccessManagerFactory;
799 if (networkAccessManagerFactory) {
800 nam = networkAccessManagerFactory->create(
parent);
811 if (!networkAccessManager)
812 networkAccessManager = createNetworkAccessManager(
const_cast<QQmlEngine*
>(
q));
813 return networkAccessManager;
831 return d->getNetworkAccessManager();
854 QSharedPointer<QQmlImageProviderBase>
sp(provider);
856 d->imageProviders.insert(std::move(providerIdLower), std::move(
sp));
869 return d->imageProviders.value(providerIdLower).data();
882 d->imageProviders.take(providerIdLower);
898 if (
d->baseUrl.isEmpty()) {
927 return d->outputWarningsToMsgLog;
943 d->outputWarningsToMsgLog =
enabled;
981 if (
auto propertyCapture =
d->propertyCapture)
982 propertyCapture->captureTranslation();
993 if (
d->propertyCapture && !
property.isConstant()) {
994 d->propertyCapture->captureProperty(
1051 if (!
type.isValid() || !
type.isSingleton())
1085 auto loadHelper = QQml::makeRefPointer<LoadHelper>(&
d->typeLoader, uri);
1087 auto [moduleStatus,
type] = loadHelper->resolveType(
typeName);
1091 if (!
type.isValid())
1093 if (!
type.isSingleton())
1111 d->translationLanguage.notify();
1131 return data->outerContext->asQQmlContext();
1150 if (
data->context) {
1151 qWarning(
"QQmlEngine::setContextForObject(): Object already has a QQmlContext");
1157 data->context = contextData.data();
1158 contextData->addOwnedObject(
data);
1193 endpoint->prev =
nullptr;
1195 while (endpoint->next) {
1197 endpoint = endpoint->next;
1203 int index = endpoint->sourceSignal;
1207 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1217 Q_ASSERT(maximumTodoIndex >= notifiesSize);
1223 const int memsetSize = (maximumTodoIndex - notifiesSize + 1) *
1225 memset(notifies + notifiesSize, 0, memsetSize);
1227 if (notifies != old) {
1228 for (
int ii = 0; ii < notifiesSize; ++ii)
1230 notifies[ii]->prev = ¬ifies[ii];
1233 notifiesSize = maximumTodoIndex + 1;
1238 maximumTodoIndex = 0;
1243 int objectIndex,
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &
compilationUnit,
1244 const QQmlRefPointer<QQmlContextData> &
context)
1302 list->connectionMask.storeRelaxed(
1305 if (index < list->notifiesSize) {
1307 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1308 endpoint->prev = &
list->notifies[
index];
1313 endpoint->next =
list->todo;
1314 if (endpoint->next) endpoint->next->prev = &endpoint->next;
1315 endpoint->prev = &
list->todo;
1316 list->todo = endpoint;
1326 for (
int ii = 0; ii <
list->notifiesSize; ++ii) {
1330 free(
list->notifies);
1342 list->connectionMask.storeRelaxed(0);
1343 list->maximumTodoIndex = 0;
1344 list->notifiesSize = 0;
1345 list->notifies =
nullptr;
1380 while (signalHandler) {
1392 locationString.append(
location.sourceFile);
1395 if (
source.size() > 100) {
1399 locationString.append(
source);
1403 qFatal(
"Object %p destroyed while one of its QML signal handlers is in progress.\n"
1404 "Most likely the object was deleted synchronously (use QObject::deleteLater() "
1405 "instead), or the application is running a nested event loop.\n"
1406 "This behavior is NOT supported!\n"
1411 signalHandler->m_prevSignal =
nullptr;
1412 signalHandler->m_nextSignal =
nullptr;
1413 delete signalHandler;
1414 signalHandler =
next;
1428 if (guard->objectDestroyed)
1429 guard->objectDestroyed(guard);
1435 delete extendedData;
1481 return ddata->propertyCache;
1488 if (
q->receivers(
SIGNAL(quit())) == 0) {
1489 qWarning(
"Signal QQmlEngine::quit() emitted, but no receivers connected to handle it.");
1496 if (
q->receivers(
SIGNAL(exit(
int))) == 0)
1497 qWarning(
"Signal QQmlEngine::exit() emitted, but no receivers connected to handle it.");
1498 emit q->exit(retCode);
1503 switch (
error.messageType()) {
1506 error.line(),
nullptr).
debug().noquote().nospace()
1507 <<
error.toString();
1511 error.line(),
nullptr).
info().noquote().nospace()
1512 <<
error.toString();
1518 <<
error.toString();
1523 <<
error.toString();
1530 for (
int ii = 0; ii < errors.size(); ++ii)
1538 if (outputWarningsToMsgLog)
1545 emit q->warnings(errors);
1546 if (outputWarningsToMsgLog)
1583 const QString &
fileName,
const QList<QQmlJS::DiagnosticMessage> &diagnosticMessages)
1585 QList<QQmlError> errors;
1587 if (
m.isWarning()) {
1594 error.setDescription(
m.message);
1595 error.setLine(qmlConvertSourceCoordinate<quint32, int>(
m.loc.startLine));
1596 error.setColumn(qmlConvertSourceCoordinate<quint32, int>(
m.loc.startColumn));
1602void QQmlEnginePrivate::cleanupScarceResources()
1611 engine->scarceResources.remove(sr);
1634 d->importDatabase.addImportPath(
path);
1655 return d->importDatabase.importPathList();
1673 d->importDatabase.setImportPathList(
paths);
1691 d->importDatabase.addPluginPath(
path);
1706 return d->importDatabase.pluginPathList();
1722 d->importDatabase.setPluginPathList(
paths);
1725#if QT_CONFIG(library)
1726#if QT_DEPRECATED_SINCE(6, 4)
1741bool QQmlEngine::importPlugin(
const QString &filePath,
const QString &uri, QList<QQmlError> *errors)
1746 uri,
QTypeRevision(), &
d->importDatabase, &qmldir, &
d->typeLoader, errors);
1747 return importer.importDynamicPlugin(filePath, uri,
false).isValid();
1780 if (
dir ==
d->offlineStoragePath)
1782 d->offlineStoragePath =
dir;
1783 Q_EMIT offlineStoragePathChanged();
1790 if (
d->offlineStoragePath.isEmpty()) {
1793 if (!dataLocation.
isEmpty()) {
1797 Q_EMIT e->q_func()->offlineStoragePathChanged();
1834 if (!
value.isUndefined())
1837 if (siinfo->scriptCallback) {
1838 value = siinfo->scriptCallback(
q,
q);
1839 if (
value.isQObject()) {
1845 singletonInstances.convertAndInsert(v4engine(), siinfo, &
value);
1847 }
else if (siinfo->qobjectCallback) {
1852 error.setDescription(
QString::asprintf(
"qmlRegisterSingletonType(): \"%s\" is not available because the callback function returns a null pointer.",
1856 type.createProxy(
o);
1866 if (!
data->context) {
1868 data->context = contextData.data();
1869 contextData->addOwnedObject(
data);
1874 singletonInstances.convertAndInsert(v4engine(), siinfo, &
value);
1875 }
else if (!siinfo->url.isEmpty()) {
1885 singletonInstances.convertAndInsert(v4engine(), siinfo, &
value);
1894 return typeLoader.isTypeLoaded(
url);
1899 return typeLoader.isScriptLoaded(
url);
1906 const auto unit = compilationUnitFromUrl(
url);
1909 executeRuntimeFunction(unit, functionIndex, thisObject, argc,
args,
types);
1917 Q_ASSERT((functionIndex >= 0) && (functionIndex < unit->runtimeFunctions.size()));
1921 Q_ASSERT(ddata && ddata->outerContext);
1925 Q_ASSERT(function->compiledFunction);
1938 if (
auto nested = function->nestedFunction()) {
1941 }
else if (function->isClosureWrapper()) {
1949 v4->
callInContext(function, thisObject, callContext, 0,
nullptr));
1951 Q_ASSERT(
result->function()->compilationUnit == function->compilationUnit);
1954 function =
result->function();
1965 if (!unit->runtimeStrings)
1970 auto unit = typeLoader.getType(
url)->compilationUnit();
1975 executable->populate();
1976 return executable.data();
1979QQmlRefPointer<QQmlContextData>
1981 const QQmlRefPointer<QQmlContextData> &parentContext,
1982 int subComponentIndex,
bool isComponentRoot)
1986 QQmlRefPointer<QQmlContextData>
context;
1992 const auto *dependentScripts = unit->dependentScriptsPtr();
1993 const qsizetype dependentScriptsSize = dependentScripts->size();
1994 if (isComponentRoot && dependentScriptsSize) {
2003 scripts->
put(
i, (
v = dependentScripts->at(
i)->scriptValueForContext(
context)));
2009#if defined(Q_OS_WIN)
2016 const LPCTSTR nameC =
reinterpret_cast<LPCTSTR
>(nativeSeparatorName.utf16());
2019#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
2021 if (FAILED(SHParseDisplayName(nameC, NULL,
reinterpret_cast<LPITEMIDLIST
>(&
file), 0, NULL)))
2024 PIDLIST_ABSOLUTE
file;
2025 if (FAILED(SHParseDisplayName(nameC, NULL, &
file, 0, NULL)))
2029 bool gotPath = SHGetPathFromIDList(
file,
buffer);
2038 canonicalName[0] = canonicalName.
at(0).toUpper();
2045#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
2049#if defined(Q_OS_DARWIN)
2050 const QString canonical =
info.canonicalFilePath();
2051#elif defined(Q_OS_WIN)
2055 const QString canonical = shellNormalizeFileName(absolute);
2058 const int absoluteLength = absolute.
length();
2059 const int canonicalLength = canonical.length();
2061 int length =
qMin(absoluteLength, canonicalLength);
2062 if (lengthIn >= 0) {
2070 if (lastSlash >= 0) {
2071 const int fileNameLength = absoluteLength - 1 - lastSlash;
2076 for (
int ii = 0; ii <
length; ++ii) {
2077 const QChar &
a = absolute.
at(absoluteLength - 1 - ii);
2078 const QChar &
c = canonical.at(canonicalLength - 1 - ii);
2080 if (
a.toLower() !=
c.toLower())
2120 , m_uri(uri.toString())
2123 auto import = std::make_shared<PendingImport>();
2124 import->uri = m_uri;
2125 QList<QQmlError> errorList;
2126 if (!Blob::addImport(
import, &errorList)) {
2135 if (!couldFindModule())
2137 QQmlTypeModule *
module = QQmlMetaType::typeModule(m_uri, QTypeRevision{});
2139 type =
module->type(typeName.toString(), {});
2153bool LoadHelper::couldFindModule()
const
2158 if (import->priority == 0)
2165#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 **)
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
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.
Type type() const
Returns the event type.
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.
QV4::ExecutionEngine * handle() const
The QJSValue class acts as a container for Qt/JavaScript data types.
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)
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
bool moveToThread(QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
Changes the thread affinity for this object and its children and returns true on success.
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.
QQmlTypeLoader * typeLoader() const
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)
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 releaseDeferredData()
BindingBitsType bindingBitsValue[InlineBindingArraySize]
static void destroyed(QAbstractDeclarativeData *, QObject *)
void disconnectNotifiers(DeleteNotifyList doDelete)
QQmlBoundSignal * signalHandlers
QQmlContextData * context
QQmlData ** prevContextObject
BindingBitsType * bindingBits
quint32 bindingBitsArraySize
QAtomicPointer< NotifyList > notifyList
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 *)
QQmlNotifierEndpoint * notify(int index) const
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)
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 std::atomic< bool > qml_debugging_enabled
\qmltype QtObject \instantiates QObject \inqmlmodule QtQml
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
QString offlineStoragePath
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(QQmlTypeLoader *typeLoader, 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.
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.
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
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.
QString toLower() const &
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QByteArray toUtf8() const &
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
qsizetype length() const noexcept
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.
const CompiledObject * objectAt(int index) const
const CompiledData::BindingPropertyData * bindingPropertyDataPerObjectAt(qsizetype objectIndex) const
std::unique_ptr< GCStateMachine > gcStateMachine
void setGCTimeLimit(int timeMs)
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.
QVector< const QQmlPropertyData * > BindingPropertyData
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
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLsizei const GLuint * paths
GLenum GLuint GLsizei const GLenum * props
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)
bool qmlProtectModule(const char *uri, int majVersion)
int qmlTypeId(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
QT_BEGIN_NAMESPACE void qml_register_types_QML()
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()
QDebug warning(QAnyStringView fileName, int lineNumber)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
unsigned long long quint64
if(qFloatDistance(a, b)<(1<< 7))
[0]
QUrl url("example.com")
[constructor-url-reference]
QItemEditorFactory * factory
LoadHelper(QQmlTypeLoader *loader, QAnyStringView uri)
ResolveTypeResult resolveType(QAnyStringView typeName)
\inmodule QtCore \reentrant
QQmlNotifierEndpoint ** notifies
QVector< QV4::Function * > runtimeFunctions
bool hasFlag(Flag flag) const
const Binding * bindingTable() const
MemoryManager * memoryManager
void clearCompilationUnits()
QQmlRefPointer< ExecutableCompilationUnit > compilationUnitForUrl(const QUrl &url) const
ExecutionContext * scriptContext() const
Heap::ArrayObject * newArrayObject(int count=0)
void trimCompilationUnits()
QQmlRefPointer< ExecutableCompilationUnit > executableCompilationUnit(QQmlRefPointer< QV4::CompiledData::CompilationUnit > &&unit)
void callInContext(QV4::Function *function, QObject *self, QV4::ExecutionContext *ctxt, int argc, void **args, QMetaType *types)
bool put(StringOrSymbol *name, const Value &v, Value *receiver=nullptr)
static Heap::QmlContext * create(QV4::ExecutionContext *parent, QQmlRefPointer< QQmlContextData > context, QObject *scopeObject)
QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const