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/qqmlloggingcategory_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>
55 || !
data->context->engine()
56 ||
data->deferredData.isEmpty()
57 ||
data->wasDeleted(
object)) {
61 if (!
data->propertyCache)
70 data->releaseDeferredData();
85 return data->context->engine();
94 QObject *rv =
data->hasExtendedData() ?
data->attachedProperties()->value(pf) : 0;
101 data->attachedProperties()->insert(pf, rv);
144 const int id =
d->metaObject->metaCall(
160 <<
" is neither a default constructible QObject, nor a default- "
161 <<
"and copy-constructible Q_GADGET, nor marked as uncreatable.\n"
162 <<
"You should not use it as a QML type.";
166 <<
"Singleton" << metaType.
name()
167 <<
"needs to be a concrete class with either a default constructor"
168 <<
"or, when adding a default constructor is infeasible, a public static"
169 <<
"create(QQmlEngine *, QJSEngine *) method.";
174 <<
"is not a QObject, but has attached properties. This won't work.";
196 const char *uri,
int versionMajor,
197 int versionMinor,
const char *qmlName,
329 const char *
import,
int importMajor,
int importMinor)
349 const char *
import,
int importMajor,
int importMinor)
357int qmlTypeId(
const char *uri,
int versionMajor,
int versionMinor,
const char *qmlName)
367 "Ensure that it outlives the engine."));
375 "as the engine it was registered with"));
384#if QT_DEPRECATED_SINCE(6, 3)
393 "must only be accessed from one engine"));
398 alreadyCalled =
true;
414 error.setDescription(
QLatin1String(
"Singleton registered by registerSingletonInstance must only be accessed from one engine"));
424 QVector<QTypeRevision> revisions;
427 const int propertyOffset =
metaObject->propertyOffset();
428 const int propertyCount =
metaObject->propertyCount();
429 for (
int coreIndex = propertyOffset, propertyEnd = propertyOffset + propertyCount;
430 coreIndex < propertyEnd; ++coreIndex) {
432 if (
int revision =
property.revision())
435 const int methodOffset =
metaObject->methodOffset();
436 const int methodCount =
metaObject->methodCount();
437 for (
int methodIndex = methodOffset, methodEnd = methodOffset + methodCount;
438 methodIndex < methodEnd; ++methodIndex) {
440 if (
int revision =
method.revision())
451template<
typename Registration>
456 : defaultVersion.majorVersion();
466 revisions.append(added);
473 bool revisionsHaveMajorVersions =
false;
474 for (
QTypeRevision revision : QVector<QTypeRevision>(*revisions)) {
476 if (revision.hasMajorVersion()) {
477 revisionsHaveMajorVersions =
true;
478 if (revision.majorVersion() < defaultVersion.majorVersion())
483 if (revisionsHaveMajorVersions) {
488 }
else if (added.
majorVersion() < defaultVersion.majorVersion()) {
494 std::sort(revisions->begin(), revisions->end());
495 const auto it = std::unique(revisions->begin(), revisions->end());
496 revisions->erase(
it, revisions->end());
503 siinfo->scriptCallback =
type.scriptApi;
504 siinfo->qobjectCallback =
type.qObjectApi;
505 siinfo->typeName =
type.typeName;
515 siinfo->typeName =
type.typeName;
522 if (!dtype.isValid())
526 return dtype.index();
533 const char *
key =
"QML.Element";
543 const char *elementName =
classInfo.value();
545 if (
qstrcmp(elementName,
"auto") == 0) {
546 const char *strippedClassName =
metaObject->className();
547 for (
const char *
c = strippedClassName; *
c !=
'\0';
c++) {
549 strippedClassName =
c + 1;
551 elementName = strippedClassName;
552 }
else if (
qstrcmp(elementName,
"anonymous") == 0) {
553 if (elementNames.isEmpty())
554 elementNames.push_back(
nullptr);
555 else if (elementNames[0] !=
nullptr)
560 if (!elementNames.isEmpty() && elementNames[0] ==
nullptr) {
562 elementNames[0] = elementName;
564 elementNames.push_back(elementName);
579 for (
int i = 1,
end = elementNames->length();
i <
end; ++
i)
581 elementNames =
nullptr;
584 for (
const QString &otherName : std::as_const(otherNames))
590 QVarLengthArray<QString, 8> otherNames;
601 const bool creatable = (elementNames[0] !=
nullptr || isValueType)
609 classInfo(
type.classInfoMetaObject,
"QML.UncreatableReason"));
610 if (noCreateReason.isEmpty())
611 noCreateReason =
QLatin1String(
"Type cannot be created in QML.");
612 }
else if (isValueType) {
624 creatable ?
type.objectSize : 0,
628 type.createValueType,
633 type.attachedPropertiesFunction,
634 type.attachedPropertiesMetaObject,
635 type.parserStatusCast,
636 type.valueSourceCast,
637 type.valueInterceptorCast,
638 type.extensionObjectCreate,
639 type.extensionMetaObject,
642 type.structVersion > 0 ?
type.finalizerCast : -1,
657 type.classInfoMetaObject,
"QML.AddedInVersion",
660 type.classInfoMetaObject,
"QML.RemovedInVersion");
665 if (
type.attachedPropertiesMetaObject)
671 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
677 if (typeRevision.version < added
678 || (removed.
isValid() && !(typeRevision.version < removed))) {
679 typeRevision.elementName =
nullptr;
680 typeRevision.create =
nullptr;
681 typeRevision.userdata =
nullptr;
683 typeRevision.elementName = elementNames[0];
684 typeRevision.create = creatable ?
type.create :
nullptr;
685 typeRevision.userdata =
type.userdata;
688 typeRevision.customParser =
type.customParserFactory();
691 type.qmlTypeIds->append(
id);
693 if (typeRevision.elementName)
694 aliasRegistrar.registerAliases(
id);
697 sequenceRevision.version = typeRevision.version;
698 sequenceRevision.revision = typeRevision.revision;
702 type.qmlTypeIds->append(
id);
720 type.instanceMetaObject,
722 type.extensionObjectCreate,
723 type.extensionMetaObject,
730 type.classInfoMetaObject,
"QML.AddedInVersion",
733 type.classInfoMetaObject,
"QML.RemovedInVersion");
742 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
748 if (revisionRegistration.version < added
749 || (removed.
isValid() && !(revisionRegistration.version < removed))) {
750 revisionRegistration.typeName =
nullptr;
751 revisionRegistration.qObjectApi =
nullptr;
753 revisionRegistration.typeName = elementNames[0];
754 revisionRegistration.qObjectApi =
type.qObjectApi;
760 type.qmlTypeIds->append(
id);
762 if (revisionRegistration.typeName)
763 aliasRegistrar.registerAliases(
id);
782 if (
type.structVersion > 1 &&
type.forceAnonymous) {
786 if (
names.isEmpty()) {
787 qWarning().nospace() <<
"Missing QML.Element class info for "
788 <<
type.classInfoMetaObject->className();
800 if (
names.isEmpty()) {
801 qWarning().nospace() <<
"Missing QML.Element class info for "
802 <<
type.classInfoMetaObject->className();
822 type.classInfoMetaObject,
"QML.AddedInVersion",
825 type.classInfoMetaObject,
"QML.ExtraVersion");
826 revisions.append(added);
830 if (revision < added)
832 if (revision.hasMajorVersion() && revision.majorVersion() >
type.version.majorVersion())
838 type.qmlTypeIds->append(
id);
904 QList<QTypeRevision> revisions;
914 const char *uri,
int versionMajor,
int versionMinor,
917 return qmlRegisterUncreatableType<QQmlTypeNotAvailable>(
918 uri, versionMajor, versionMinor, qmlName,
message);
924 const char *uri,
int versionMajor,
const QMetaObject *classInfoMetaObject,
941 &QQmlTypeNotAvailable::staticMetaObject,
944 attachedPropertiesFunc<T>(),
945 attachedPropertiesMetaObject<T>(),
953 qmlCreateCustomParser<T>,
1001 QObject *
object,
int coreIndex,
int notifyIndex,
bool isConstant,
1008 capture->captureProperty(
object, coreIndex, notifyIndex);
1019 capture->captureProperty(
object, propertyCache,
property);
1025 if (
cache == ancestor)
1039template<
bool StrictType>
1058template<
bool StrictType = false>
1067 const int coreIndex = propertyData->
coreIndex();
1068 if (
data.qmlData->hasPendingBindingBit(coreIndex))
1069 data.qmlData->flushPendingBinding(coreIndex);
1076template<
bool StrictType = false>
1118 if (
data.qmlData &&
data.qmlData->hasPendingBindingBit(coreIndex))
1119 data.qmlData->flushPendingBinding(coreIndex);
1124 void *
a[] = {
target,
nullptr };
1136 void *
a[] = {
source,
nullptr };
1137 data.metaObject->metacall(
1148 if (propType == QMetaType::fromType<QVariant>())
1149 return loadObjectProperty<true>(l,
object,
variant, aotContext);
1152 return loadObjectProperty<true>(l,
object,
variant->
data(), aotContext);
1159 if (propType == QMetaType::fromType<QVariant>())
1160 return writeBackObjectProperty<true>(l,
object,
variant);
1163 return writeBackObjectProperty<true>(l,
object,
variant->
data());
1175 if (propType == QMetaType::fromType<QVariant>())
1190 if (propType == QMetaType::fromType<QVariant>())
1197template<
bool StrictType,
typename Op>
1210template<
bool StrictType = false>
1216 property->resetProperty(object, {});
1225template<
bool StrictType = false>
1229 property->writeProperty(
object,
value, {});
1233template<
typename Op>
1237 if (
data.result != ObjectPropertyResult::OK)
1243 op(
data.metaObject, coreIndex);
1244 return ObjectPropertyResult::OK;
1260 void *args[] = { nullptr };
1285 if (!foundMetaObject)
1288 while (foundMetaObject && foundMetaObject != typeMetaObject)
1289 foundMetaObject = foundMetaObject->superClass();
1291 if (!foundMetaObject)
1294 if (propertyType == lookupType)
1303 switch (propertyType.
sizeOf()) {
1306 ? lookupType == QMetaType::fromType<quint8>()
1307 : lookupType == QMetaType::fromType<qint8>();
1310 ? lookupType == QMetaType::fromType<ushort>()
1311 : lookupType == QMetaType::fromType<short>();
1318 ? (lookupType == QMetaType::fromType<int>()
1319 || lookupType == QMetaType::fromType<uint>())
1320 : lookupType == QMetaType::fromType<int>();
1323 ? lookupType == QMetaType::fromType<qulonglong>()
1324 : lookupType == QMetaType::fromType<qlonglong>();
1328 }
else if (propertyType != lookupType) {
1339 if (propType == QMetaType::fromType<QVariant>())
1340 return storeObjectProperty<true>(l,
object,
variant);
1343 return resetObjectProperty<true>(l,
object, v4);
1346 return storeObjectProperty<true>(l,
object,
variant->
data());
1350 return storeObjectProperty<true>(l,
object, converted.
data());
1363 const QMetaType propType =
property.metaType();
1364 if (propType == QMetaType::fromType<QVariant>())
1389 QV4::Scope scope(aotContext->engine->handle());
1391 aotContext->compilationUnit->runtimeStrings[l->
nameIndex]);
1402 if (ddata->isQueuedForDeletion)
1403 return ObjectLookupResult::Failure;
1406 if (!ddata->propertyCache) {
1409 property = ddata->propertyCache->property(
1410 name.getPointer(),
object, aotContext->qmlContext);
1413 const bool doVariantLookup =
type == QMetaType::fromType<QVariant>();
1417 return ObjectLookupResult::Failure;
1420 name->toQStringNoThrow().toUtf8().constData());
1422 return ObjectLookupResult::Failure;
1426 return ObjectLookupResult::Failure;
1435 return doVariantLookup
1436 ? ObjectLookupResult::FallbackAsVariant
1437 : ObjectLookupResult::Fallback;
1441 return ObjectLookupResult::Failure;
1447 return doVariantLookup
1448 ? ObjectLookupResult::ObjectAsVariant
1449 : ObjectLookupResult::Object;
1457 const int coreIndex =
metaObject->indexOfProperty(
name.constData());
1469 const int missingLineNumber =
engine->currentStackFrame->missingLineNumber();
1470 const int lineNumber =
engine->currentStackFrame->lineNumber();
1471 Q_ASSERT(missingLineNumber != lineNumber);
1475 if (
it->line == missingLineNumber) {
1476 it->line = lineNumber;
1482 amendStackTrace(&
engine->exceptionStackTrace);
1487 amendStackTrace(
error->d()->stackTrace);
1519bool AOTCompiledContext::captureQmlContextPropertyLookup(
uint index)
const
1541void AOTCompiledContext::captureTranslation()
const
1544 capture->captureTranslation();
1547QString AOTCompiledContext::translationContext()
const
1549#if QT_CONFIG(translation)
1550 return QV4::GlobalExtensions::currentTranslationContext(
engine->
handle());
1570 return QMetaType::fromType<int>();
1575 return QMetaType::fromType<QObject *>();
1585 return metaObject->property(coreIndex).metaType();
1592 if (
type == QMetaType::fromType<QVariant>())
1594 if (
type == QMetaType::fromType<QJSValue>())
1596 if (
type == QMetaType::fromType<QJSPrimitiveValue>()) {
1615 case ObjectLookupResult::ObjectAsVariant:
1616 case ObjectLookupResult::Object: {
1632 case ObjectLookupResult::FallbackAsVariant:
1633 case ObjectLookupResult::Fallback: {
1637 const QMetaType propType =
property.metaType();
1650 case ObjectLookupResult::Failure:
1655 switch (storeResult) {
1656 case ObjectPropertyResult::NeedsInit:
1659 case ObjectPropertyResult::Deleted:
1661 QStringLiteral(
"Value is null and could not be converted to an object"));
1663 case ObjectPropertyResult::OK:
1682 = qobject_cast<QQmlLoggingCategory *>(
wrapper)) {
1685 if (!loggingCategory) {
1687 QStringLiteral(
"A QmlLoggingCatgory was provided without a valid name"));
1689 return loggingCategory;
1694 return qmlEngine() ? &lcQml() : &lcJs();
1697void AOTCompiledContext::writeToConsole(
1708 function.constData(), loggingCategory->categoryName());
1730 int ctorIndex,
void *ctorArg)
const
1733 resultMetaType, resultMetaObject, ctorIndex, ctorArg);
1736QDateTime AOTCompiledContext::constructDateTime(
double timestamp)
const
1747 double year,
double month,
double day,
double hours,
1748 double minutes,
double seconds,
double msecs)
const
1751 year, month, day, hours, minutes, seconds, msecs,
engine->
handle()));
1754bool AOTCompiledContext::callQmlContextPropertyLookup(
1765 compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1769 function->call(qmlScopeObject,
args,
types, argc);
1773void AOTCompiledContext::initCallQmlContextPropertyLookup(
uint index)
const
1796 if (objectId != -1 && objectId < context->numIdValues())
1807 capture->captureProperty(
context->idValueBindings(objectId));
1812void AOTCompiledContext::initLoadContextIdLookup(
uint index)
const
1818 const QQmlRefPointer<QQmlContextData> ownContext =
qmlContext;
1820 const int propertyIdx =
context->propertyIndex(
name);
1821 if (propertyIdx == -1 || propertyIdx >=
context->numIdValues())
1824 if (
context.data() == ownContext.data()) {
1837bool AOTCompiledContext::callObjectPropertyLookup(
1846 QStringLiteral(
"Property '%1' of object [object Object] is not a function")
1847 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1851 function->call(
object,
args,
types, argc);
1855void AOTCompiledContext::initCallObjectPropertyLookup(
uint index)
const
1862bool AOTCompiledContext::callGlobalLookup(
1870 QStringLiteral(
"Property '%1' of object [null] is not a function")
1871 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1875 function->call(
nullptr,
args,
types, argc);
1879void AOTCompiledContext::initCallGlobalLookup(
uint index)
const
1896void AOTCompiledContext::initLoadGlobalLookup(
uint index)
const
1907 if (!qmlScopeObject) {
1909 compilationUnit->runtimeStrings[l->
nameIndex]->toQString());
1922 case ObjectPropertyResult::NeedsInit:
1924 case ObjectPropertyResult::Deleted:
1927 .
arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
1929 case ObjectPropertyResult::OK:
1933 Q_UNREACHABLE_RETURN(
false);
1936bool AOTCompiledContext::writeBackScopeObjectPropertyLookup(
uint index,
void *
source)
const
1949 case ObjectPropertyResult::NeedsInit:
1951 case ObjectPropertyResult::Deleted:
1952 case ObjectPropertyResult::OK:
1956 Q_UNREACHABLE_RETURN(
false);
1970 case ObjectLookupResult::ObjectAsVariant:
1971 case ObjectLookupResult::Object:
1974 case ObjectLookupResult::FallbackAsVariant:
1975 case ObjectLookupResult::Fallback:
1978 case ObjectLookupResult::Failure:
2005template<QmlContextPropertyGetter qmlContextPropertyGetter>
2010 if (importNamespace != AOTCompiledContext::InvalidStringId) {
2017 =
context->qmlContext->imports()->query(
import, typeLoader).importNamespace) {
2021 scope.
engine,
nullptr,
context->qmlContext->imports(), importRef));
2038 ?
"%1 was a singleton at compile time, "
2039 "but is not a singleton anymore."
2040 :
"%1 was not a singleton at compile time, "
2041 "but is a singleton now.")
2048void AOTCompiledContext::initLoadSingletonLookup(
uint index,
uint importNamespace)
const
2051 initTypeWrapperLookup<QV4::QQmlContextWrapper::lookupSingleton>(
this, l, importNamespace);
2064 object,
wrapper->d()->type().attachedPropertiesFunction(
2069void AOTCompiledContext::initLoadAttachedLookup(
2079 if (importNamespace != InvalidStringId) {
2080 QV4::ScopedString import(scope, compilationUnit->runtimeStrings[importNamespace]);
2082 =
qmlContext->imports()->query(
import, typeLoader).importNamespace) {
2089 if (!
type.isValid()) {
2102bool AOTCompiledContext::loadTypeLookup(
uint index,
void *
target)
const
2111 QMetaType metaType = typeWrapper->type().typeId();
2117void AOTCompiledContext::initLoadTypeLookup(
uint index,
uint importNamespace)
const
2120 initTypeWrapperLookup<QV4::QQmlContextWrapper::lookupType>(
this, l, importNamespace);
2126 const auto doThrow = [&]() {
2129 .arg(compilationUnit->runtimeStrings[l->
nameIndex]->toQString()));
2149 case ObjectPropertyResult::Deleted:
2151 case ObjectPropertyResult::NeedsInit:
2153 case ObjectPropertyResult::OK:
2157 Q_UNREACHABLE_RETURN(
false);
2179 case ObjectPropertyResult::NeedsInit:
2181 case ObjectPropertyResult::Deleted:
2182 case ObjectPropertyResult::OK:
2186 Q_UNREACHABLE_RETURN(
false);
2197 case ObjectLookupResult::Object:
2200 case ObjectLookupResult::ObjectAsVariant:
2203 case ObjectLookupResult::Fallback:
2206 case ObjectLookupResult::FallbackAsVariant:
2209 case ObjectLookupResult::Failure:
2254void AOTCompiledContext::initGetValueLookup(
2270 const bool isUnsigned
2305void AOTCompiledContext::initGetEnumLookup(
2307 const char *enumerator,
const char *enumValue)
const
2317 const int enumIndex =
metaObject->indexOfEnumerator(enumerator);
2326 const auto doThrow = [&]() {
2328 QStringLiteral(
"Value is null and could not be converted to an object"));
2349 case ObjectPropertyResult::Deleted:
2351 case ObjectPropertyResult::NeedsInit:
2353 case ObjectPropertyResult::OK:
2357 Q_UNREACHABLE_RETURN(
false);
2368 case ObjectLookupResult::Object:
2371 case ObjectLookupResult::ObjectAsVariant:
2374 case ObjectLookupResult::Fallback:
2377 case ObjectLookupResult::FallbackAsVariant:
2380 case ObjectLookupResult::Failure:
2387bool 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)
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]
#define Q_DECLARE_LOGGING_CATEGORY(name)
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)
void qmlExecuteDeferred(QObject *object)
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()
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::@584::@607 qmlEnumValueLookup
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)
struct QV4::Lookup::@584::@606 qmlTypeLookup
static bool setterQObject(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
ReturnedValue(* getter)(Lookup *l, ExecutionEngine *engine, const Value &object)
struct QV4::Lookup::@584::@598 qobjectLookup
struct QV4::Lookup::@584::@600 qobjectFallbackLookup
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::@584::@601 qgadgetLookup
static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object)
static ReturnedValue getterFallbackAsVariant(Lookup *l, ExecutionEngine *engine, const Value &object)
void releasePropertyCache()
struct QV4::Lookup::@584::@604 qmlContextIdObjectLookup
static bool setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
struct QV4::Lookup::@584::@603 qmlContextSingletonLookup
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