7#include <private/qqmlrefcount_p.h>
11#include <private/qqmlglobal_p.h>
13#include <private/qv4object_p.h>
14#include <private/qv4variantobject_p.h>
15#include <private/qv4functionobject_p.h>
16#include <private/qv4scopedvalue_p.h>
17#include <private/qv4jscall_p.h>
18#include <private/qv4qobjectwrapper_p.h>
19#include <private/qv4sequenceobject_p.h>
20#include <private/qqmlpropertycachecreator_p.h>
21#include <private/qqmlpropertycachemethodarguments_p.h>
22#include <private/qqmlvaluetypewrapper_p.h>
24#include <QtCore/qsequentialiterable.h>
33 auto encodedIndex =
quintptr(prop->data);
35 quintptr inheritanceDepth = encodedIndex >> (usableBits / 2);
36 m_id = encodedIndex & ((
quintptr(1) << (usableBits / 2)) - 1);
40 while (inheritanceDepth--)
41 mo =
mo->parentVMEMetaObject();
61 m_list =
static_cast<QV4::Heap::Object *
>(
v->heapObject());
68 QV4::Scope scope(m_list->internalClass->engine);
69 QV4::Heap::ArrayData *arrayData = m_list->arrayData;
79 arrayData->vtable()->put(
85 QV4::Scope scope(m_list->internalClass->engine);
92 QV4::Scope scope(m_list->internalClass->engine);
157void QQmlVMEVariantQObjectPtr::objectDestroyedImpl(
QQmlGuardImpl *guard)
163 if (This->m_index >= 0) {
174 This->m_target->activate(This->m_target->object, This->m_target->methodOffset() + This->m_index,
nullptr);
228 int coreIndex = encodedIndex.
coreIndex();
235 void *argv[1] = { &
target };
238 pd = newPropertyCache->property(valueTypeIndex);
278 if (
Q_UNLIKELY(vi->m_propertyIndex.coreIndex() ==
index.coreIndex())) {
279 qWarning() <<
"Attempting to set another interceptor on "
280 <<
object->metaObject()->className() <<
"property"
281 <<
object->metaObject()->property(
index.coreIndex()).name()
286 interceptor->m_propertyIndex =
index;
287 interceptor->m_next = interceptors;
288 interceptors = interceptor;
298 return object->qt_metacall(
c,
id,
a);
304 if (vi->m_propertyIndex.coreIndex() !=
id)
307 const int valueIndex = vi->m_propertyIndex.valueTypeIndex();
309 const QMetaType metaType =
data->propertyCache->property(
id)->propType();
317 const int changedProperty
319 ? *
static_cast<int *
>(
a[4])
320 :
QV4::ReferenceObject::AllProperties;
322 || changedProperty == valueIndex) {
325 data->context->engine(), metaType);
362 valueType->
read(
object,
id);
373 valueType->
writeOnGadget(valueProp, std::move(prevComponentValue));
376 vi->write(newComponentValue);
383 object->qt_metacall(
c,
id,
a);
396 if (
o->qt_metacast(
mo->className()) !=
nullptr)
421 aliasEndpoints(
nullptr), compilationUnit(qmlCompilationUnit), compiledObject(
nullptr)
567 return s->toQString();
580 if (!
v ||
v->d()->data().userType() != QMetaType::QUrl)
582 return v->d()->data().value<
QUrl>();
594 if (!
v ||
v->d()->data().userType() != QMetaType::QDate)
596 return v->d()->data().value<
QDate>();
608 if (!
v ||
v->d()->data().userType() != QMetaType::QTime)
610 return v->d()->data().value<
QTime>();
622 if (!
v ||
v->d()->data().userType() != QMetaType::QDateTime)
627#if QT_CONFIG(regularexpression)
637 if (!
v ||
v->d()->data().userType() != QMetaType::QRegularExpression)
652 if (!
v ||
v->d()->data().userType() != QMetaType::QSizeF)
654 return v->d()->data().value<
QSizeF>();
666 if (!
v ||
v->d()->data().userType() != QMetaType::QPointF)
668 return v->d()->data().value<
QPointF>();
709 if (!
v ||
v->d()->data().userType() != QMetaType::QRectF)
711 return v->d()->data().value<
QRectF>();
733 if (
id < propertyCount) {
761 while (
mo &&
mo !=
this) {
762 mo =
mo->parentVMEMetaObject();
767 qmlWarning(
object) <<
"Too many objects in inheritance hierarchy "
772 qmlWarning(
object) <<
"Too many properties in object "
776 quintptr encodedIndex = (inheritanceDepth << idBits) +
id;
779 *
static_cast<QQmlListProperty<QObject> *
>(
a[0])
780 = QQmlListProperty<QObject>(
781 object,
reinterpret_cast<void *
>(
quintptr(encodedIndex)),
788 const void *
data = sequence
794 qmlWarning(
object) <<
"Cannot find member data";
822#if QT_CONFIG(regularexpression)
824 = readPropertyAsRegularExpression(
id);
860 *
reinterpret_cast<QObject **
>(
a[0]) =
nullptr;
863 const void *
data =
nullptr;
873 qmlWarning(
object) <<
"Cannot find member data";
878 bool needActivate =
false;
892 void *
data = sequence
903 type.isSequentialContainer()) {
909 QMetaType::fromType<QSequentialIterable>(),
912 engine, propType, iterable.metaContainer(),
a[0]);
916 md->set(
engine,
id, sequence);
917 if (sequence->isUndefined()) {
919 <<
"Could not create a QML sequence object for "
925 qmlWarning(
object) <<
"Cannot find member data";
960#if QT_CONFIG(regularexpression)
962 != readPropertyAsRegularExpression(
id);
997 needActivate =
wrap->object() !=
arg;
998 else if (
arg !=
nullptr || !sv->
isNull())
1007 needActivate =
true;
1010 needActivate =
true;
1015 needActivate =
true;
1021 qmlWarning(
object) <<
"Cannot find member data";
1033 id -= propertyCount;
1035 if (
id < aliasCount) {
1040 *
reinterpret_cast<void **
>(
a[0]) =
nullptr;
1065 int coreIndex = encodedIndex.
coreIndex();
1066 const int valueTypePropertyIndex = encodedIndex.
valueTypeIndex();
1068 const auto removePendingBinding
1072 int flags = *
reinterpret_cast<int*
>(
a[3]);
1075 if (targetData && targetData->hasBindingBit(coreIndex)) {
1077 targetData->clearBindingBit(coreIndex);
1083 if (valueTypePropertyIndex != -1) {
1084 if (!targetDData->propertyCache)
1086 const QQmlPropertyData *pd = targetDData->propertyCache->property(coreIndex);
1091 removePendingBinding(
target, coreIndex, encodedIndex);
1097 valueTypePropertyIndex);
1102 void *argv[1] = { &
target };
1104 removePendingBinding(
1105 target, valueTypePropertyIndex,
1111 removePendingBinding(
target, coreIndex, encodedIndex);
1125 int plainSignals =
signalCount + propertyCount + aliasCount;
1126 if (
id < plainSignals) {
1133 if (
id < methodCount) {
1153 "Exception occurred during compilation of function: ")
1159 auto methodData =
cache->method(_id);
1160 auto arguments = methodData->hasArguments() ? methodData->arguments() :
nullptr;
1164 Q_ASSERT(parameterCount == function->formalParameterCount());
1165 function->call(
object,
a,
arguments->types, parameterCount);
1167 Q_ASSERT(function->formalParameterCount() == 0);
1168 const QMetaType returnType = methodData->propType();
1169 function->call(
object,
a, &returnType, 0);
1174 if (
error.isValid())
1188 return object->qt_metacall(
c, _id,
a);
1194 qWarning(
"QQmlVMEMetaObject: Internal error - attempted to evaluate a function in an invalid context");
1211 return (md->data() +
id)->asReturnedValue();
1224 return v->d()->data();
1244 QObject *valueObject =
nullptr;
1250 v->addVmePropertyReference();
1254 valueObject =
wrapper->object();
1257 if (valueObject && !guard) {
1264 if (
p->enforcesLocation()) {
1278 QV4::Heap::QQmlValueTypeWrapper *
p =
wrapper->d();
1310 v->addVmePropertyReference();
1314 md->set(
engine,
id, newv);
1318 bool needActivate =
false;
1319 if (
value.userType() == QMetaType::QObjectStar) {
1327 needActivate = (!
v ||
1328 v->d()->data().userType() !=
value.userType() ||
1329 v->d()->data() !=
value);
1417 *valueTypeIndex = -1;
1479 while (vme && vme->propOffset() > coreIndex)
1480 vme = vme->parentVMEMetaObject();
1489 while (vme && vme->methodOffset() > coreIndex)
1490 vme = vme->parentVMEMetaObject();
1503 while (vme && vme->signalOffset() > coreIndex)
1504 vme = vme->parentVMEMetaObject();
1514 if ((*it)->m_index ==
index) {
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
qsizetype size() const noexcept
const_iterator constBegin() const noexcept
void append(parameter_type t)
const_iterator constEnd() const noexcept
QDynamicMetaObjectData * metaObject
static QObjectPrivate * get(QObject *o)
\inmodule QtCore\reentrant
QObject * idValue(int index) const
QQmlNotifier * idValueBindings(int index) const
QQmlEngine * engine() const
static QQmlPropertyCache::ConstPtr ensurePropertyCache(QObject *object)
static bool wasDeleted(const QObject *)
static QQmlData * get(QObjectPrivate *priv, bool create)
void warning(const QQmlError &)
static QQmlEnginePrivate * get(QQmlEngine *e)
void referenceScarceResources()
void dereferenceScarceResources()
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlError class encapsulates a QML error.
void setDescription(const QString &)
Sets the error description.
void setValue(const QVariant &value)
static QQmlGadgetPtrWrapper * instance(QQmlEngine *engine, QMetaType type)
QMetaProperty property(int index) const
void write(QObject *obj, int idx, QQmlPropertyData::WriteFlags flags, int internalIndex=QV4::ReferenceObject::AllProperties) const
QVariant readOnGadget(const QMetaProperty &property) const
void read(QObject *obj, int idx)
void writeOnGadget(const QMetaProperty &property, const QVariant &value)
void setObject(QObject *g)
void connect(QObject *source, int sourceSignal, QQmlEngine *engine, bool doNotify=true)
QMetaType propType() const
@ RemoveBindingOnAliasWrite
static QQmlPropertyIndex fromEncoded(qint32 encodedIndex)
int valueTypeIndex() const
static void removeBinding(const QQmlProperty &that)
The QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
void replace(qsizetype i, QObject *o) const
void append(QObject *o) const
QQmlVMEResolvedList(QQmlListProperty< QObject > *prop)
QObject * at(qsizetype i) const
void activateSignal() const
QQmlVMEMetaObject * m_target
void setGuardedValue(QObject *obj, QQmlVMEMetaObject *target, int index)
QQmlVMEVariantQObjectPtr()
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
The QSequentialIterable class is an iterable interface for a container in a QVariant.
\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...
T * data() const noexcept
\inmodule QtCore \reentrant
const CompiledObject * objectAt(int index) const
void set(ExecutionEngine *engine, const Value &value)
Managed * asManaged() const
void markOnce(MarkStack *markStack)
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QMetaType metaType() const
const void * constData() const
qDeleteAll(list.begin(), list.end())
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
QList< QVariant > arguments
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static QDBusError::ErrorType get(const char *name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static void realloc(Object *o, Type newType, uint alloc, bool enforceAttributes)
@ AliasPointsToPointerObject
qint32_le encodedMetaPropertyIndex
quint32 targetObjectId() const
bool isObjectAlias() const
bool hasFlag(Flag flag) const
bool isAliasToLocalAlias() const
quint32_le localAliasIndex
const Property * propertyTable() const
const Alias * aliasTable() const
CommonType commonType() const
static constexpr ReturnedValue undefined()
QQmlError catchExceptionAsQmlError()
ReturnedValue throwRangeError(const Value &value)
QV4::ReturnedValue fromVariant(const QVariant &)
Heap::Object * newObject()
Heap::String * newString(char16_t c)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
Heap::Object * newVariantObject(const QMetaType type, const void *data)
ExecutionEngine * engine() const
static Heap::MemberData * allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old=nullptr)
bool set(StringOrSymbol *name, const Value &v, ThrowOnFailure shouldThrow)
static void ensureWrapper(ExecutionEngine *engine, QObject *object)
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
static constexpr const int AllProperties
static bool readReference(HeapObject *ref)
static HeapObject * detached(HeapObject *ref)
bool hasException() const
static void * getRawContainerPtr(const Sequence *object, QMetaType typeHint)
static ReturnedValue fromData(QV4::ExecutionEngine *engine, QMetaType type, QMetaSequence metaSequence, const void *data)
QV4_NEARLY_ALWAYS_INLINE double doubleValue() const
bool booleanValue() const
static constexpr Value fromInt32(int i)
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
static constexpr Value fromBoolean(bool b)
static constexpr Value undefinedValue()
static Value fromDouble(double d)
static constexpr Value fromReturnedValue(ReturnedValue val)
static constexpr Value nullValue()
V4_NEEDS_DESTROY void addVmePropertyReference() const
void removeVmePropertyReference() const
static void markCustom(Engine *engine, F &&markFunction)
uchar data[MaxInternalSize]