6#include <QtQml/qqmlprivate.h>
8#include <private/qjsvalue_p.h>
9#include <private/qqmlbuiltinfunctions_p.h>
10#include <private/qqmlcomponent_p.h>
11#include <private/qqmlengine_p.h>
12#include <private/qqmlfinalizer_p.h>
13#include <private/qqmlloggingcategorybase_p.h>
14#include <private/qqmlmetatype_p.h>
15#include <private/qqmlmetatypedata_p.h>
16#include <private/qqmltype_p_p.h>
17#include <private/qqmltypemodule_p.h>
18#include <private/qqmltypewrapper_p.h>
19#include <private/qqmlvaluetypewrapper_p.h>
20#include <private/qv4dateobject_p.h>
21#include <private/qv4errorobject_p.h>
22#include <private/qv4identifiertable_p.h>
23#include <private/qv4lookup_p.h>
24#include <private/qv4qobjectwrapper_p.h>
26#include <QtCore/qmutex.h>
52 || !
data->context->engine()
53 ||
data->deferredData.isEmpty()
54 ||
data->wasDeleted(
object)) {
58 if (!
data->propertyCache)
67 data->releaseDeferredData();
82 return data->context->engine();
91 QObject *rv =
data->hasExtendedData() ?
data->attachedProperties()->value(pf) : 0;
98 data->attachedProperties()->insert(pf, rv);
141 const int id =
d->metaObject->metaCall(
157 <<
" is neither a default constructible QObject, nor a default- "
158 <<
"and copy-constructible Q_GADGET, nor marked as uncreatable.\n"
159 <<
"You should not use it as a QML type.";
163 <<
"Singleton" << metaType.
name()
164 <<
"needs to be a concrete class with either a default constructor"
165 <<
"or, when adding a default constructor is infeasible, a public static"
166 <<
"create(QQmlEngine *, QJSEngine *) method.";
171 <<
"is not a QObject, but has attached properties. This won't work.";
193 const char *uri,
int versionMajor,
194 int versionMinor,
const char *qmlName,
326 const char *
import,
int importMajor,
int importMinor)
346 const char *
import,
int importMajor,
int importMinor)
354int qmlTypeId(
const char *uri,
int versionMajor,
int versionMinor,
const char *qmlName)
368 auto loadHelper = QQml::makeRefPointer<LoadHelper>(&enginePriv->typeLoader, uri);
369 auto type = loadHelper->resolveType(qmlName).type;
370 if (
type.availableInVersion(revision))
381 "Ensure that it outlives the engine."));
389 "as the engine it was registered with"));
398#if QT_DEPRECATED_SINCE(6, 3)
407 "must only be accessed from one engine"));
412 alreadyCalled =
true;
428 error.setDescription(
QLatin1String(
"Singleton registered by registerSingletonInstance must only be accessed from one engine"));
438 QVector<QTypeRevision> revisions;
441 const int propertyOffset =
metaObject->propertyOffset();
442 const int propertyCount =
metaObject->propertyCount();
443 for (
int coreIndex = propertyOffset, propertyEnd = propertyOffset + propertyCount;
444 coreIndex < propertyEnd; ++coreIndex) {
446 if (
int revision =
property.revision())
449 const int methodOffset =
metaObject->methodOffset();
450 const int methodCount =
metaObject->methodCount();
451 for (
int methodIndex = methodOffset, methodEnd = methodOffset + methodCount;
452 methodIndex < methodEnd; ++methodIndex) {
454 if (
int revision =
method.revision())
465template<
typename Registration>
470 : defaultVersion.majorVersion();
474 registration->revision = revision;
480 revisions.append(added);
487 bool revisionsHaveMajorVersions =
false;
488 for (
QTypeRevision revision : QVector<QTypeRevision>(*revisions)) {
490 if (revision.hasMajorVersion()) {
491 revisionsHaveMajorVersions =
true;
492 if (revision.majorVersion() < defaultVersion.majorVersion())
497 if (revisionsHaveMajorVersions) {
502 }
else if (added.
majorVersion() < defaultVersion.majorVersion()) {
508 std::sort(revisions->begin(), revisions->end());
509 const auto it = std::unique(revisions->begin(), revisions->end());
510 revisions->erase(
it, revisions->end());
517 siinfo->scriptCallback =
type.scriptApi;
518 siinfo->qobjectCallback =
type.qObjectApi;
519 siinfo->typeName =
type.typeName;
529 siinfo->typeName =
type.typeName;
536 if (!dtype.isValid())
540 return dtype.index();
547 const char *
key =
"QML.Element";
557 const char *elementName =
classInfo.value();
559 if (
qstrcmp(elementName,
"auto") == 0) {
560 const char *strippedClassName =
metaObject->className();
561 for (
const char *
c = strippedClassName; *
c !=
'\0';
c++) {
563 strippedClassName =
c + 1;
565 elementName = strippedClassName;
566 }
else if (
qstrcmp(elementName,
"anonymous") == 0) {
567 if (elementNames.isEmpty())
568 elementNames.push_back(
nullptr);
569 else if (elementNames[0] !=
nullptr)
574 if (!elementNames.isEmpty() && elementNames[0] ==
nullptr) {
576 elementNames[0] = elementName;
578 elementNames.push_back(elementName);
593 for (
int i = 1,
end = elementNames->length();
i <
end; ++
i)
595 elementNames =
nullptr;
598 for (
const QString &otherName : std::as_const(otherNames))
604 QVarLengthArray<QString, 8> otherNames;
615 const bool creatable = (elementNames[0] !=
nullptr || isValueType)
623 classInfo(
type.classInfoMetaObject,
"QML.UncreatableReason"));
624 if (noCreateReason.isEmpty())
625 noCreateReason =
QLatin1String(
"Type cannot be created in QML.");
626 }
else if (isValueType) {
638 creatable ?
type.objectSize : 0,
642 type.createValueType,
647 type.attachedPropertiesFunction,
648 type.attachedPropertiesMetaObject,
649 type.parserStatusCast,
650 type.valueSourceCast,
651 type.valueInterceptorCast,
652 type.extensionObjectCreate,
653 type.extensionMetaObject,
656 type.structVersion > 0 ?
type.finalizerCast : -1,
671 type.classInfoMetaObject,
"QML.AddedInVersion",
674 type.classInfoMetaObject,
"QML.RemovedInVersion");
679 if (
type.attachedPropertiesMetaObject)
685 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
691 if (typeRevision.version < added
692 || (removed.
isValid() && !(typeRevision.version < removed))) {
693 typeRevision.elementName =
nullptr;
694 typeRevision.create =
nullptr;
695 typeRevision.userdata =
nullptr;
697 typeRevision.elementName = elementNames[0];
698 typeRevision.create = creatable ?
type.create :
nullptr;
699 typeRevision.userdata =
type.userdata;
702 typeRevision.customParser =
type.customParserFactory();
705 type.qmlTypeIds->append(
id);
707 if (typeRevision.elementName)
708 aliasRegistrar.registerAliases(
id);
711 sequenceRevision.version = typeRevision.version;
712 sequenceRevision.revision = typeRevision.revision;
716 type.qmlTypeIds->append(
id);
734 type.instanceMetaObject,
736 type.extensionObjectCreate,
737 type.extensionMetaObject,
744 type.classInfoMetaObject,
"QML.AddedInVersion",
747 type.classInfoMetaObject,
"QML.RemovedInVersion");
756 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
762 if (revisionRegistration.version < added
763 || (removed.
isValid() && !(revisionRegistration.version < removed))) {
764 revisionRegistration.typeName =
nullptr;
765 revisionRegistration.qObjectApi =
nullptr;
767 revisionRegistration.typeName = elementNames[0];
768 revisionRegistration.qObjectApi =
type.qObjectApi;
774 type.qmlTypeIds->append(
id);
776 if (revisionRegistration.typeName)
777 aliasRegistrar.registerAliases(
id);
796 if (
type.structVersion > 1 &&
type.forceAnonymous) {
800 if (
names.isEmpty()) {
801 qWarning().nospace() <<
"Missing QML.Element class info for "
802 <<
type.classInfoMetaObject->className();
814 if (
names.isEmpty()) {
815 qWarning().nospace() <<
"Missing QML.Element class info for "
816 <<
type.classInfoMetaObject->className();
836 type.classInfoMetaObject,
"QML.AddedInVersion",
839 type.classInfoMetaObject,
"QML.ExtraVersion");
840 revisions.append(added);
844 if (revision < added)
846 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
852 type.qmlTypeIds->append(
id);
918 QList<QTypeRevision> revisions;
928 const char *uri,
int versionMajor,
int versionMinor,
931 return qmlRegisterUncreatableType<QQmlTypeNotAvailable>(
932 uri, versionMajor, versionMinor, qmlName,
message);
938 const char *uri,
int versionMajor,
const QMetaObject *classInfoMetaObject,
955 &QQmlTypeNotAvailable::staticMetaObject,
958 attachedPropertiesFunc<T>(),
959 attachedPropertiesMetaObject<T>(),
967 qmlCreateCustomParser<T>,
1015 QObject *
object,
int coreIndex,
int notifyIndex,
bool isConstant,
1022 capture->captureProperty(
object, coreIndex, notifyIndex);
1033 capture->captureProperty(
object, propertyCache,
property);
1039 if (
cache == ancestor)
1053template<
bool StrictType>
1072template<
bool StrictType = false>
1081 const int coreIndex = propertyData->
coreIndex();
1082 if (
data.qmlData->hasPendingBindingBit(coreIndex))
1083 data.qmlData->flushPendingBinding(coreIndex);
1090template<
bool StrictType = false>
1132 if (
data.qmlData &&
data.qmlData->hasPendingBindingBit(coreIndex))
1133 data.qmlData->flushPendingBinding(coreIndex);
1138 void *
a[] = {
target,
nullptr };
1150 void *
a[] = {
source,
nullptr };
1151 data.metaObject->metacall(
1162 if (propType == QMetaType::fromType<QVariant>())
1163 return loadObjectProperty<true>(l,
object,
variant, aotContext);
1166 return loadObjectProperty<true>(l,
object,
variant->
data(), aotContext);
1173 if (propType == QMetaType::fromType<QVariant>())
1174 return writeBackObjectProperty<true>(l,
object,
variant);
1177 return writeBackObjectProperty<true>(l,
object,
variant->
data());
1189 if (propType == QMetaType::fromType<QVariant>())
1204 if (propType == QMetaType::fromType<QVariant>())
1211template<
bool StrictType,
typename Op>
1224template<
bool StrictType = false>
1230 property->resetProperty(object, {});
1239template<
bool StrictType = false>
1243 property->writeProperty(
object,
value, {});
1247template<
typename Op>
1251 if (
data.result != ObjectPropertyResult::OK)
1257 op(
data.metaObject, coreIndex);
1258 return ObjectPropertyResult::OK;
1274 void *args[] = { nullptr };
1299 if (!foundMetaObject)
1302 while (foundMetaObject && foundMetaObject != typeMetaObject)
1303 foundMetaObject = foundMetaObject->superClass();
1305 if (!foundMetaObject)
1308 if (propertyType == lookupType)
1317 switch (propertyType.
sizeOf()) {
1320 ? lookupType == QMetaType::fromType<quint8>()
1321 : lookupType == QMetaType::fromType<qint8>();
1324 ? lookupType == QMetaType::fromType<ushort>()
1325 : lookupType == QMetaType::fromType<short>();
1332 ? (lookupType == QMetaType::fromType<int>()
1333 || lookupType == QMetaType::fromType<uint>())
1334 : lookupType == QMetaType::fromType<int>();
1337 ? lookupType == QMetaType::fromType<qulonglong>()
1338 : lookupType == QMetaType::fromType<qlonglong>();
1342 }
else if (propertyType != lookupType) {
1353 if (propType == QMetaType::fromType<QVariant>())
1354 return storeObjectProperty<true>(l,
object,
variant);
1357 return resetObjectProperty<true>(l,
object, v4);
1360 return storeObjectProperty<true>(l,
object,
variant->
data());
1364 return storeObjectProperty<true>(l,
object, converted.
data());
1377 const QMetaType propType =
property.metaType();
1378 if (propType == QMetaType::fromType<QVariant>())
1403 QV4::Scope scope(aotContext->engine->handle());
1405 aotContext->compilationUnit->runtimeStrings[l->
nameIndex]);
1416 if (ddata->isQueuedForDeletion)
1417 return ObjectLookupResult::Failure;
1420 if (!ddata->propertyCache) {
1423 property = ddata->propertyCache->property(
1424 name.getPointer(),
object, aotContext->qmlContext);
1427 const bool doVariantLookup =
type == QMetaType::fromType<QVariant>();
1431 return ObjectLookupResult::Failure;
1434 name->toQStringNoThrow().toUtf8().constData());
1436 return ObjectLookupResult::Failure;
1440 return ObjectLookupResult::Failure;
1449 return doVariantLookup
1450 ? ObjectLookupResult::FallbackAsVariant
1451 : ObjectLookupResult::Fallback;
1455 return ObjectLookupResult::Failure;
1461 return doVariantLookup
1462 ? ObjectLookupResult::ObjectAsVariant
1463 : ObjectLookupResult::Object;
1471 const int coreIndex =
metaObject->indexOfProperty(
name.constData());
1483 const int missingLineNumber =
engine->currentStackFrame->missingLineNumber();
1484 const int lineNumber =
engine->currentStackFrame->lineNumber();
1485 Q_ASSERT(missingLineNumber != lineNumber);
1489 if (
it->line == missingLineNumber) {
1490 it->line = lineNumber;
1496 amendStackTrace(&
engine->exceptionStackTrace);
1501 amendStackTrace(
error->d()->stackTrace);
1533bool AOTCompiledContext::captureQmlContextPropertyLookup(
uint index)
const
1555void AOTCompiledContext::captureTranslation()
const
1558 capture->captureTranslation();
1561QString AOTCompiledContext::translationContext()
const
1563#if QT_CONFIG(translation)
1564 return QV4::GlobalExtensions::currentTranslationContext(
engine->
handle());
1584 return QMetaType::fromType<int>();
1589 return QMetaType::fromType<QObject *>();
1599 return metaObject->property(coreIndex).metaType();
1606 if (
type == QMetaType::fromType<QVariant>())
1608 if (
type == QMetaType::fromType<QJSValue>())
1610 if (
type == QMetaType::fromType<QJSPrimitiveValue>()) {
1629 case ObjectLookupResult::ObjectAsVariant:
1630 case ObjectLookupResult::Object: {
1646 case ObjectLookupResult::FallbackAsVariant:
1647 case ObjectLookupResult::Fallback: {
1651 const QMetaType propType =
property.metaType();
1664 case ObjectLookupResult::Failure:
1669 switch (storeResult) {
1670 case ObjectPropertyResult::NeedsInit:
1673 case ObjectPropertyResult::Deleted:
1675 QStringLiteral(
"Value is null and could not be converted to an object"));
1677 case ObjectPropertyResult::OK:
1696 = qobject_cast<QQmlLoggingCategoryBase *>(
wrapper)) {
1699 if (!loggingCategory) {
1701 QStringLiteral(
"A QmlLoggingCatgory was provided without a valid name"));
1703 return loggingCategory;
1708 return qmlEngine() ? &lcQml() : &lcJs();
1711void AOTCompiledContext::writeToConsole(
1722 function.constData(), loggingCategory->categoryName());
1744 int ctorIndex,
void *ctorArg)
const
1747 resultMetaType, resultMetaObject, ctorIndex, ctorArg);
1750QDateTime AOTCompiledContext::constructDateTime(
double timestamp)
const
1761 double year,
double month,
double day,
double hours,
1762 double minutes,
double seconds,
double msecs)
const
1765 year, month, day, hours, minutes, seconds, msecs,
engine->
handle()));
1768bool AOTCompiledContext::callQmlContextPropertyLookup(
1779 compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1783 function->call(qmlScopeObject,
args,
types, argc);
1787void AOTCompiledContext::initCallQmlContextPropertyLookup(
uint index)
const
1809 objectId = context->propertyIndex(
name);
1810 if (objectId != -1 && objectId < context->numIdValues())
1821 capture->captureProperty(context->idValueBindings(objectId));
1822 *
static_cast<QObject **
>(
target) = context->idValue(objectId);
1826void AOTCompiledContext::initLoadContextIdLookup(
uint index)
const
1832 const QQmlRefPointer<QQmlContextData> ownContext =
qmlContext;
1833 for (
auto context = ownContext; context; context = context->
parent()) {
1834 const int propertyIdx = context->propertyIndex(
name);
1835 if (propertyIdx == -1 || propertyIdx >= context->numIdValues())
1838 if (context.data() == ownContext.data()) {
1851bool AOTCompiledContext::callObjectPropertyLookup(
1860 QStringLiteral(
"Property '%1' of object [object Object] is not a function")
1861 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1865 function->call(
object,
args,
types, argc);
1869void AOTCompiledContext::initCallObjectPropertyLookup(
uint index)
const
1876bool AOTCompiledContext::callGlobalLookup(
1884 QStringLiteral(
"Property '%1' of object [null] is not a function")
1885 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1889 function->call(
nullptr,
args,
types, argc);
1893void AOTCompiledContext::initCallGlobalLookup(
uint index)
const
1910void AOTCompiledContext::initLoadGlobalLookup(
uint index)
const
1921 if (!qmlScopeObject) {
1923 compilationUnit->runtimeStrings[l->
nameIndex]->toQString());
1936 case ObjectPropertyResult::NeedsInit:
1938 case ObjectPropertyResult::Deleted:
1941 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1943 case ObjectPropertyResult::OK:
1947 Q_UNREACHABLE_RETURN(
false);
1950bool AOTCompiledContext::writeBackScopeObjectPropertyLookup(
uint index,
void *
source)
const
1963 case ObjectPropertyResult::NeedsInit:
1965 case ObjectPropertyResult::Deleted:
1966 case ObjectPropertyResult::OK:
1970 Q_UNREACHABLE_RETURN(
false);
1984 case ObjectLookupResult::ObjectAsVariant:
1985 case ObjectLookupResult::Object:
1988 case ObjectLookupResult::FallbackAsVariant:
1989 case ObjectLookupResult::Fallback:
1992 case ObjectLookupResult::Failure:
2019template<QmlContextPropertyGetter qmlContextPropertyGetter>
2023 Q_ASSERT(!context->engine->hasError());
2024 if (importNamespace != AOTCompiledContext::InvalidStringId) {
2026 QV4::ScopedString import(scope, context->compilationUnit->runtimeStrings[importNamespace]);
2031 = context->qmlContext->imports()->query(
import, typeLoader).importNamespace) {
2035 scope.
engine,
nullptr, context->qmlContext->imports(), importRef));
2052 ?
"%1 was a singleton at compile time, "
2053 "but is not a singleton anymore."
2054 :
"%1 was not a singleton at compile time, "
2055 "but is a singleton now.")
2056 .
arg(context->compilationUnit->runtimeStrings[l->
nameIndex]->toQString());
2062void AOTCompiledContext::initLoadSingletonLookup(
uint index,
uint importNamespace)
const
2065 initTypeWrapperLookup<QV4::QQmlContextWrapper::lookupSingleton>(
this, l, importNamespace);
2078 object,
wrapper->d()->type().attachedPropertiesFunction(
2083void AOTCompiledContext::initLoadAttachedLookup(
2093 if (importNamespace != InvalidStringId) {
2094 QV4::ScopedString import(scope, compilationUnit->runtimeStrings[importNamespace]);
2096 =
qmlContext->imports()->query(
import, typeLoader).importNamespace) {
2103 if (!
type.isValid()) {
2116bool AOTCompiledContext::loadTypeLookup(
uint index,
void *
target)
const
2125 QMetaType metaType = typeWrapper->type().typeId();
2131void AOTCompiledContext::initLoadTypeLookup(
uint index,
uint importNamespace)
const
2134 initTypeWrapperLookup<QV4::QQmlContextWrapper::lookupType>(
this, l, importNamespace);
2140 const auto doThrow = [&]() {
2143 .arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
2163 case ObjectPropertyResult::Deleted:
2165 case ObjectPropertyResult::NeedsInit:
2167 case ObjectPropertyResult::OK:
2171 Q_UNREACHABLE_RETURN(
false);
2193 case ObjectPropertyResult::NeedsInit:
2195 case ObjectPropertyResult::Deleted:
2196 case ObjectPropertyResult::OK:
2200 Q_UNREACHABLE_RETURN(
false);
2211 case ObjectLookupResult::Object:
2214 case ObjectLookupResult::ObjectAsVariant:
2217 case ObjectLookupResult::Fallback:
2220 case ObjectLookupResult::FallbackAsVariant:
2223 case ObjectLookupResult::Failure:
2268void AOTCompiledContext::initGetValueLookup(
2284 const bool isUnsigned
2319void AOTCompiledContext::initGetEnumLookup(
2321 const char *enumerator,
const char *enumValue)
const
2331 const int enumIndex =
metaObject->indexOfEnumerator(enumerator);
2340 const auto doThrow = [&]() {
2342 QStringLiteral(
"Value is null and could not be converted to an object"));
2363 case ObjectPropertyResult::Deleted:
2365 case ObjectPropertyResult::NeedsInit:
2367 case ObjectPropertyResult::OK:
2371 Q_UNREACHABLE_RETURN(
false);
2382 case ObjectLookupResult::Object:
2385 case ObjectLookupResult::ObjectAsVariant:
2388 case ObjectLookupResult::Fallback:
2391 case ObjectLookupResult::FallbackAsVariant:
2394 case ObjectLookupResult::Failure:
2401bool AOTCompiledContext::setValueLookup(
\inmodule QtCore\reentrant
The QJSEngine class provides an environment for evaluating JavaScript code.
QV4::ExecutionEngine * handle() const
bool hasError() const
Returns true if the last JavaScript execution resulted in an exception or if throwError() was called.
static void setObjectOwnership(QObject *, ObjectOwnership)
Sets the ownership of object.
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
static QJSValue fromReturnedValue(QV4::ReturnedValue d)
The QJSValue class acts as a container for Qt/JavaScript data types.
bool isUndefined() const
Returns true if this QJSValue is of the primitive type Undefined or if the managed value has been cle...
int toInt(bool *ok=nullptr, int base=10) const
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.
static QObjectPrivate * get(QObject *o)
QObject * parent() const
Returns a pointer to the parent object.
QThread * thread() const
Returns the thread in which the object lives.
std::vector< ConstructionState > DeferredState
static void completeDeferred(QQmlEnginePrivate *enginePriv, DeferredState *deferredState)
static void beginDeferred(QQmlEnginePrivate *enginePriv, QObject *object, DeferredState *deferredState)
The QQmlContext class defines a context within a QML engine.
static void flushPendingBinding(QObject *object, int coreIndex)
QQmlPropertyCache::ConstPtr propertyCache
static bool wasDeleted(const QObject *)
static QQmlData * get(QObjectPrivate *priv, bool create)
quint32 isQueuedForDeletion
static bool baseModulesUninitialized
static QQmlEnginePrivate * get(QQmlEngine *e)
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 qmlUnregisterModuleImport(const char *uri, int moduleMajor, const char *import, int importMajor, int importMinor)
Removes a module import previously registered with qmlRegisterModuleImport()
void qmlRegisterModuleImport(const char *uri, int moduleMajor, const char *import, int importMajor, int importMinor)
Registers a qmldir-import for module uri of major version moduleMajor.
The QQmlError class encapsulates a QML error.
const QQmlPropertyData * property(const K &key, QObject *object, const QQmlRefPointer< QQmlContextData > &context) const
void readProperty(QObject *target, void *property) const
static void removeBinding(const QQmlProperty &that)
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
static QUrl normalize(const QUrl &unNormalizedUrl)
static QQmlType compositeQmlType(const QQmlRefPointer< QV4::CompiledData::CompilationUnit > &unit, QQmlTypeLoader *typeLoader, const QString &type)
static QVariant constructValueType(QMetaType targetMetaType, const QMetaObject *targetMetaObject, int ctorIndex, void *ctorArg)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
static constexpr QTypeRevision fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
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 fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
constexpr bool hasMinorVersion() const
Returns true if the minor version is known, otherwise false.
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
constexpr bool hasMajorVersion() const
Returns true if the major version is known, otherwise false.
constexpr quint8 minorVersion() const
Returns the minor version encoded in the revision.
constexpr bool isValid() const
Returns true if the major version or the minor version is known, otherwise false.
static constexpr QTypeRevision fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given value.
constexpr quint8 majorVersion() const
Returns the major version encoded in the revision.
const QQmlRefPointer< QV4::CompiledData::CompilationUnit > & baseCompilationUnit() const
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
QMetaType metaType() const
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
static void initTypeWrapperLookup(const AOTCompiledContext *context, QV4::Lookup *l, uint importNamespace)
QTypeRevision revisionClassInfo(const QMetaObject *metaObject, const char *key, QTypeRevision defaultValue=QTypeRevision())
void Q_QML_EXPORT qmlunregister(RegistrationType, quintptr)
QV4::ReturnedValue(*)(QV4::Lookup *l, QV4::ExecutionEngine *engine, QV4::Value *thisObject) QmlContextPropertyGetter
static FallbackPropertyQmlData findFallbackPropertyQmlData(QV4::Lookup *l, QObject *object)
ObjectPropertyResult loadObjectProperty(QV4::Lookup *l, QObject *object, void *target, const AOTCompiledContext *aotContext)
static ObjectPropertyResult storeFallbackProperty(QV4::Lookup *l, QObject *object, void *value)
static int indexOfOwnClassInfo(const QMetaObject *metaObject, const char *key, int startOffset=-1)
static ObjectPropertyResult resetFallbackProperty(QV4::Lookup *l, QObject *object, const QMetaProperty *property, QV4::ExecutionEngine *v4)
static bool initValueLookup(QV4::Lookup *l, QV4::ExecutableCompilationUnit *compilationUnit, const QMetaObject *metaObject, QMetaType type)
static ObjectPropertyResult storeObjectAsVariant(QV4::ExecutionEngine *v4, QV4::Lookup *l, QObject *object, void *value)
ObjectPropertyResult writeBackObjectAsVariant(QV4::Lookup *l, QObject *object, void *source)
Q_QML_EXPORT void qmlRegistrationWarning(QmlRegistrationWarning warning, QMetaType type)
static void captureFallbackProperty(QObject *object, int coreIndex, int notifyIndex, bool isConstant, const AOTCompiledContext *aotContext)
@ CompositeSingletonRegistration
@ SequentialContainerRegistration
@ SequentialContainerAndRevisionsRegistration
@ QmlUnitCacheHookRegistration
@ SingletonAndRevisionsRegistration
@ TypeAndRevisionsRegistration
static ObjectPropertyResult storeFallbackAsVariant(QV4::ExecutionEngine *v4, QV4::Lookup *l, QObject *object, void *value)
static ObjectPropertyResult changeObjectProperty(QV4::Lookup *l, QObject *object, Op op)
Q_QML_EXPORT QList< QTypeRevision > revisionClassInfos(const QMetaObject *metaObject, const char *key)
static bool inherits(const QQmlPropertyCache *descendent, const QQmlPropertyCache *ancestor)
ObjectPropertyQmlData findObjectPropertyQmlData(QV4::Lookup *l, QObject *object)
static ObjectLookupResult initObjectLookup(const AOTCompiledContext *aotContext, QV4::Lookup *l, QObject *object, QMetaType type)
static void captureObjectProperty(QObject *object, const QQmlPropertyCache *propertyCache, const QQmlPropertyData *property, const AOTCompiledContext *aotContext)
static bool isUndefined(const void *value, QMetaType type)
static void amendException(QV4::ExecutionEngine *engine)
@ UnconstructibleSingleton
Q_QML_EXPORT QObject * qmlExtendedObject(QObject *, int)
ObjectPropertyResult writeBackObjectProperty(QV4::Lookup *l, QObject *object, void *source)
static ObjectPropertyResult loadFallbackProperty(QV4::Lookup *l, QObject *object, void *target, const AOTCompiledContext *aotContext)
const CachedQmlUnit *(* QmlUnitCacheLookupFunction)(const QUrl &url)
const char * classInfo(const QMetaObject *metaObject, const char *key)
ObjectPropertyResult loadFallbackAsVariant(QV4::Lookup *l, QObject *object, void *target, const AOTCompiledContext *aotContext)
ObjectPropertyResult loadObjectAsVariant(QV4::Lookup *l, QObject *object, void *target, const AOTCompiledContext *aotContext)
static bool isTypeCompatible(QMetaType lookupType, QMetaType propertyType)
bool boolClassInfo(const QMetaObject *metaObject, const char *key, bool defaultValue=false)
int Q_QML_EXPORT qmlregister(RegistrationType, void *)
AutoParentResult(* AutoParentFunction)(QObject *object, QObject *parent)
Q_QML_EXPORT QMetaType compositeListMetaType(QV4::ExecutableCompilationUnit *unit, const QString &elementName)
Q_QML_EXPORT QMetaType compositeMetaType(QV4::ExecutableCompilationUnit *unit, const QString &elementName)
void qmlRegisterTypeAndRevisions< QQmlTypeNotAvailable, void >(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject, QVector< int > *qmlTypeIds, const QMetaObject *extension, bool)
static ObjectPropertyResult writeBackFallbackProperty(QV4::Lookup *l, QObject *object, void *source)
static ObjectPropertyResult resetObjectProperty(QV4::Lookup *l, QObject *object, QV4::ExecutionEngine *v4)
static QQmlPropertyCapture * propertyCapture(const AOTCompiledContext *aotContext)
static ObjectPropertyResult storeObjectProperty(QV4::Lookup *l, QObject *object, void *value)
ObjectPropertyResult writeBackFallbackAsVariant(QV4::Lookup *l, QObject *object, void *source)
static ObjectPropertyResult changeFallbackProperty(QV4::Lookup *l, QObject *object, Op op)
Combined button and popup list for selecting options.
Scoped< FunctionObject > ScopedFunctionObject
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData)
Scoped< String > ScopedString
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
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]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLenum GLenum * types
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLsizei GLsizei GLchar * source
bool qmlProtectModule(const char *uri, int majVersion)
int qmlTypeId(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
void qmlRegisterModule(const char *uri, int versionMajor, int versionMinor)
QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *object, const QMetaObject *attachedMetaObject)
QVarLengthArray< const char *, 8 > ElementNames
int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
static void doRegisterSingletonAndRevisions(const QQmlPrivate::RegisterSingletonTypeAndRevisions &type, const ElementNames &elementNames)
static ElementNames classElementNames(const QMetaObject *metaObject)
void assignVersions(Registration *registration, QTypeRevision revision, QTypeRevision defaultVersion)
static int finalizeType(const QQmlType &dtype)
QQmlEngine * qmlEngine(const QObject *obj)
static QVector< QTypeRevision > availableRevisions(const QMetaObject *metaObject)
int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &message)
QQmlContext * qmlContext(const QObject *obj)
static QObject * resolveAttachedProperties(QQmlAttachedPropertiesFunc pf, QQmlData *data, QObject *object, bool create)
QObject * qmlAttachedPropertiesObject(QObject *object, QQmlAttachedPropertiesFunc func, bool create)
static void uniqueRevisions(QVector< QTypeRevision > *revisions, QTypeRevision defaultVersion, QTypeRevision added)
void qmlClearTypeRegistrations()
QT_BEGIN_NAMESPACE void qmlExecuteDeferred(QObject *object)
static QQmlDirParser::Import resolveImport(const QString &uri, int importMajor, int importMinor)
QObject * qmlExtendedObject(QObject *object)
static bool checkSingletonInstance(QQmlEngine *engine, QObject *instance)
static void doRegisterTypeAndRevisions(const QQmlPrivate::RegisterTypeAndRevisions &type, const ElementNames &elementNames)
static QVector< QTypeRevision > prepareRevisions(const QMetaObject *metaObject, QTypeRevision added)
static QTypeRevision resolveModuleVersion(int moduleMajor)
static QQmlType::SingletonInstanceInfo::ConstPtr singletonInstanceInfo(const QQmlPrivate::RegisterSingletonType &type)
@ QQmlModuleImportModuleAny
void qmlClearEnginePlugins()
QQmlPrivate::QQmlAttachedPropertiesFunc< QObject > QQmlAttachedPropertiesFunc
QDebug warning(QAnyStringView fileName, int lineNumber)
#define qUtf8Printable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
unsigned long long quint64
QT_BEGIN_NAMESPACE typedef signed char qint8
obj metaObject() -> className()
AliasRegistrar(const ElementNames *elementNames)
void registerAliases(int typeId)
void setInstructionPointer(int offset) const
QJSValue jsMetaType(int index) const
void setReturnValueUndefined() const
QQmlEngine * qmlEngine() const
QV4::ExecutableCompilationUnit * compilationUnit
QObject * thisObject() const
const QMetaObject * metaObject
ObjectPropertyResult result
ObjectPropertyResult result
QPointer< QObject > m_object
QObject * operator()(QQmlEngine *, QJSEngine *)
QQmlRefPointer< const SingletonInstanceInfo > ConstPtr
QQmlRefPointer< SingletonInstanceInfo > Ptr
Heap::InternalClass ** runtimeClasses
Heap::String ** runtimeStrings
static QDateTime timestampToDateTime(double timestamp, QTimeZone zone=QTimeZone::LocalTime)
static QDateTime stringToDateTime(const QString &string, ExecutionEngine *engine)
static double componentsToTimestamp(double year, double month, double day, double hours, double mins, double secs, double ms, ExecutionEngine *v4)
IdentifierTable * identifierTable
CppStackFrame * currentStackFrame
static bool metaTypeFromJS(const Value &value, QMetaType type, void *data)
ReturnedValue throwError(const Value &value)
ReturnedValue throwReferenceError(const Value &value)
QV4::ReturnedValue fromVariant(const QVariant &)
String * id_destroy() const
String * id_toString() const
QV4::ReturnedValue metaTypeToJS(QMetaType type, const void *data)
QQmlEngine * qmlEngine() const
TypeLoader * typeLoader()
ReturnedValue throwTypeError()
ReturnedValue asReturnedValue() const
QString toQString() const
PropertyKey asPropertyKey(const Heap::String *str)
ReturnedValue(* globalGetter)(Lookup *l, ExecutionEngine *engine)
struct QV4::Lookup::@586::@600 qobjectFallbackLookup
ReturnedValue(* qmlContextPropertyGetter)(Lookup *l, ExecutionEngine *engine, Value *thisObject)
static ReturnedValue getterQObject(Lookup *l, ExecutionEngine *engine, const Value &object)
static ReturnedValue getterQObjectAsVariant(Lookup *l, ExecutionEngine *engine, const Value &object)
static bool setterQObjectAsVariant(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
static bool setterQObject(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
ReturnedValue(* getter)(Lookup *l, ExecutionEngine *engine, const Value &object)
struct QV4::Lookup::@586::@607 qmlEnumValueLookup
struct QV4::Lookup::@586::@598 qobjectLookup
struct QV4::Lookup::@586::@603 qmlContextSingletonLookup
struct QV4::Lookup::@586::@606 qmlTypeLookup
static bool setterFallbackAsVariant(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
bool(* setter)(Lookup *l, ExecutionEngine *engine, Value &object, const Value &v)
struct QV4::Lookup::@586::@604 qmlContextIdObjectLookup
static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object)
static ReturnedValue getterFallbackAsVariant(Lookup *l, ExecutionEngine *engine, const Value &object)
void releasePropertyCache()
static bool setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
struct QV4::Lookup::@586::@601 qgadgetLookup
static ReturnedValue lookupAttached(Lookup *l, ExecutionEngine *engine, const Value &object)
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
static ReturnedValue lookupSingleton(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupContextObjectProperty(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupIdObjectInParentContext(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupIdObject(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupScopeObjectProperty(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupScopeFallbackProperty(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue lookupType(Lookup *l, ExecutionEngine *engine, Value *base)
static ReturnedValue create(ExecutionEngine *, QObject *, const QQmlType &, Heap::QQmlTypeWrapper::TypeNameMode=Heap::QQmlTypeWrapper::IncludeEnums)
static ReturnedValue lookupEnumValue(Lookup *l, ExecutionEngine *engine, const Value &base)
static ReturnedValue lookupSingletonProperty(Lookup *l, ExecutionEngine *engine, const Value &base)
static bool lookupSetter(QV4::Lookup *l, QV4::ExecutionEngine *engine, QV4::Value &object, const QV4::Value &value)
static ReturnedValue lookupGetter(Lookup *lookup, ExecutionEngine *engine, const Value &object)
bool hasException() const