4#ifndef QV4QOBJECTWRAPPER_P_H
5#define QV4QOBJECTWRAPPER_P_H
18#include <private/qbipointer_p.h>
19#include <private/qintrusivelist_p.h>
20#include <private/qqmldata_p.h>
21#include <private/qv4functionobject_p.h>
22#include <private/qv4lookup_p.h>
23#include <private/qv4value_p.h>
25#include <QtCore/qglobal.h>
26#include <QtCore/qmetatype.h>
27#include <QtCore/qpair.h>
28#include <QtCore/qhash.h>
38struct QObjectSlotDispatcher;
42struct QQmlValueTypeWrapper;
63#define QObjectMethodMembers(class, Member) \
64 Member(class, Pointer, Object *, wrapper) \
79 FunctionObject::destroy();
82 void ensureMethodsCache(
const QMetaObject *thisMeta);
88 bool isDetached()
const;
97 QV4::Heap::QObjectMethod::ThisObjectMode checkThisObject(
const QMetaObject *thisMeta)
const;
137 IncludeImports = 0x8,
147 return o->metaObject();
155 Flags flags,
bool *hasProperty =
nullptr)
const;
162 static bool setQmlProperty(
178 void destroyObject(
bool lastCall);
193 static bool virtualResolveLookupSetter(
237 if (
Q_LIKELY(ddata && ddata->jsEngineId ==
engine->m_engineId && !ddata->jsWrapper.isUndefined())) {
239 return ddata->jsWrapper.value();
242 return wrap_slowPath(
engine,
object);
251 return wrapConst_slowPath(
engine,
object);
264template <
typename ReversalFunctor>
267 QObjectWrapper::Flags
flags, ReversalFunctor revertLookup)
271 Heap::Object *
o =
static_cast<Heap::Object *
>(
object.heapObject());
273 return revertLookup();
282 return revertLookup();
292 return revertLookup();
296 return revertLookup();
302template <
typename ReversalFunctor>
305 QObjectWrapper::Flags
flags, ReversalFunctor revertLookup)
309 Heap::Object *
o =
static_cast<Heap::Object *
>(
object.heapObject());
311 return revertLookup();
320 return revertLookup();
325 return revertLookup();
328 return revertLookup();
333 return method->asReturnedValue();
337 return revertLookup();
342 return revertLookup();
345 return v->asReturnedValue();
355 enum { DestroyMethod = -1, ToStringMethod = -2 };
361 Heap::Object *
wrapper, Heap::Object *
object);
410 private QHash<QObjectBiPointer, QV4::WeakValue>
424 template<
typename Po
inter>
431 template<
typename Po
inter>
442 template<
typename Po
inter>
451 template<
typename Po
inter>
457 it->markOnce(markStack);
461 void removeDestroyedObject(
QObject*);
static JNINativeMethod methods[]
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
T & operator[](const Key &key)
Returns the value associated with the key as a modifiable reference.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator find(const QObjectBiPointer &key)
Returns an iterator pointing to the item with the key in the hash.
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
QQmlPropertyCache::ConstPtr propertyCache
static bool wasDeleted(const QObject *)
static QQmlData * get(QObjectPrivate *priv, bool create)
const QQmlPropertyCache::ConstPtr & parent() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
void insert(Pointer key, Heap::Object *value)
QHash< QObjectBiPointer, QV4::WeakValue >::ConstIterator ConstIterator
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
QHash< QObjectBiPointer, QV4::WeakValue >::value_type value_type
ReturnedValue value() const
object setProperty("down", true)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
bool canConvert(const QQmlPropertyCache *fromMo, const QQmlPropertyCache *toMo)
std::pair< T1, T2 > QPair
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_OPERATORS_FOR_FLAGS(Flags)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
QQmlContext * qmlContext(const QObject *obj)
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define DECLARE_HEAP_OBJECT(name, base)
#define DECLARE_MARKOBJECTS(class)
#define V4_OBJECT2(DataClass, superClass)
obj metaObject() -> className()
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
void init(QObject *object)
void init(QObject *object, int signalIndex)
void setObject(QObject *o)
Heap::QObjectMethod * method
const QQmlPropertyData * propertyData
struct QV4::Lookup::@576::@601 qobjectLookup
struct QV4::Lookup::@576::@602 qobjectMethodLookup
const QQmlPropertyCache * propertyCache
ExecutionEngine * engine() const
ReturnedValue getQmlProperty(const QQmlRefPointer< QQmlContextData > &qmlContext, String *name, Flags flags, bool *hasProperty=nullptr) const
static ReturnedValue getProperty(ExecutionEngine *engine, Heap::Object *wrapper, QObject *object, const QQmlPropertyData *property, Flags flags)
static ReturnedValue lookupPropertyGetterImpl(Lookup *l, ExecutionEngine *engine, const Value &object, Flags flags, ReversalFunctor revert)
Q_DECLARE_FLAGS(Flags, Flag)
static ReturnedValue getQmlProperty(ExecutionEngine *engine, const QQmlRefPointer< QQmlContextData > &qmlContext, Heap::Object *wrapper, QObject *object, String *name, Flags flags, bool *hasProperty=nullptr, const QQmlPropertyData **property=nullptr)
const QMetaObject * metaObject() const
static ReturnedValue wrapConst(ExecutionEngine *engine, QObject *object)
static ReturnedValue lookupMethodGetterImpl(Lookup *l, ExecutionEngine *engine, const Value &object, Flags flags, ReversalFunctor revert)
V4_NEEDS_DESTROY int signalIndex() const