5#ifndef QV4QOBJECTWRAPPER_P_H
6#define QV4QOBJECTWRAPPER_P_H
19#include <private/qbipointer_p.h>
20#include <private/qintrusivelist_p.h>
21#include <private/qqmldata_p.h>
22#include <private/qv4functionobject_p.h>
23#include <private/qv4lookup_p.h>
24#include <private/qv4value_p.h>
26#include <QtCore/qglobal.h>
27#include <QtCore/qmetatype.h>
28#include <QtCore/qhash.h>
38class QQmlPropertyCache;
40class QQmlObjectOrGadget;
47struct QQmlValueTypeWrapper;
68#define QObjectMethodMembers(class, Member)
69 Member(class, Pointer, Object *, wrapper)
72 DECLARE_MARKOBJECTS(QObjectMethod)
75 alignas(
alignof(QQmlPropertyData))
std::byte _singleMethod[
sizeof(QQmlPropertyData)];
79 void init(
QV4::ExecutionEngine *engine, Object *wrapper,
int index);
82 if (methods !=
reinterpret_cast<
const QQmlPropertyData *>(&_singleMethod))
84 FunctionObject::destroy();
87 void ensureMethodsCache(
const QMetaObject *thisMeta);
90 const QMetaObject *metaObject()
const;
91 QObject *object()
const;
93 bool isDetached()
const;
94 bool isAttachedTo(QObject *o)
const;
102 QV4::Heap::QObjectMethod::ThisObjectMode checkThisObject(
const QMetaObject *thisMeta)
const;
106 void init(QObject *object,
int signalIndex);
113 QObject *
object()
const {
return qObj.data(); }
117 QV4QPointer<QObject> qObj;
162 Q_NODISCARD_X(
"Use ensureWrapper if you don't need the return value")
164 Q_NODISCARD_X(
"Throwing the const wrapper away can cause it to be garbage collected")
269inline bool canConvert(
const QQmlPropertyCache *fromMo,
const QQmlPropertyCache *toMo)
274 fromMo = fromMo->parent().data();
363struct QQmlValueTypeWrapper;
448 Iterator begin() {
return QHash<QObjectBiPointer, QV4::WeakValue>::begin(); }
450 Iterator end() {
return QHash<QObjectBiPointer, QV4::WeakValue>::end(); }
452 template<
typename Pointer>
455 QHash<QObjectBiPointer, WeakValue>::operator[](key).set(value->internalClass->engine, value);
456 connect(key, SIGNAL(destroyed(QObject*)),
this, SLOT(removeDestroyedObject(QObject*)));
459 template<
typename Pointer>
462 ConstIterator it = find(key);
464 ? QV4::WeakValue().value()
470 template<
typename Pointer>
479 template<
typename Pointer>
480 void mark(Pointer key, MarkStack *markStack)
485 it->markOnce(markStack);
QV4::ExecutionEngine * engine
void insert(Pointer key, Heap::Object *value)
void mark(Pointer key, MarkStack *markStack)
ConstIterator end() const
QHash< QObjectBiPointer, QV4::WeakValue >::Iterator Iterator
ReturnedValue value(Pointer key) const
Iterator erase(Iterator it)
ConstIterator begin() const
Combined button and popup list for selecting options.
DECLARE_EXPORTED_HEAP_OBJECT(QObjectMethod, FunctionObject)
bool canConvert(const QQmlPropertyCache *fromMo, const QQmlPropertyCache *toMo)
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
#define Q_MANAGED_TYPE(type)
void init(QObject *object, int signalIndex)
void setObject(QObject *o)
Iterator & operator=(const Iterator &o)
Iterator(void *p, int idx)
bool operator!=(const Iterator &other)
Iterator(const Iterator &o)
static ExecutionEngine * getEngine(const Value *v)
~PersistentValueStorage()
static void free(Value *v)
void mark(MarkStack *markStack)
const SparseArrayNode * begin() const
const SparseArrayNode * end() const