From 59c5038af49b82a8ee9c93455cdf093fa097aec8 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 26 Apr 2024 11:56:55 +0200 Subject: QtQml: Move QMetaObjectWrapper into separate header/impl files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to use it from QQmlTypeWrapper and avoid circular includes. Task-number: QTBUG-124662 Change-Id: I4c78a17eb262a303b7239bbdd853ec02d609c330 Reviewed-by: Olivier De Cannière Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4qobjectwrapper_p.h | 37 ++++++++++++--------------------- 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'src/qml/jsruntime/qv4qobjectwrapper_p.h') diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 7225612f08..1af8fc887f 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -33,6 +33,7 @@ class QObject; class QQmlData; class QQmlPropertyCache; class QQmlPropertyData; +class QQmlObjectOrGadget; namespace QV4 { struct QObjectSlotDispatcher; @@ -97,16 +98,6 @@ DECLARE_EXPORTED_HEAP_OBJECT(QObjectMethod, FunctionObject) { QV4::Heap::QObjectMethod::ThisObjectMode checkThisObject(const QMetaObject *thisMeta) const; }; -struct QMetaObjectWrapper : FunctionObject { - const QMetaObject* metaObject; - QQmlPropertyData *constructors; - int constructorCount; - - void init(const QMetaObject* metaObject); - void destroy(); - void ensureConstructorsCache(); -}; - struct QmlSignalHandler : Object { void init(QObject *object, int signalIndex); void destroy() { @@ -385,24 +376,22 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject QObject *thisObject, void **argv, const QMetaType *types, int argc) const; static QPair extractQtMethod(const QV4::FunctionObject *function); -}; - -struct Q_QML_EXPORT QMetaObjectWrapper : public QV4::FunctionObject -{ - V4_OBJECT2(QMetaObjectWrapper, QV4::FunctionObject) - V4_NEEDS_DESTROY +private: + friend struct QMetaObjectWrapper; - static ReturnedValue create(ExecutionEngine *engine, const QMetaObject* metaObject); - const QMetaObject *metaObject() const { return d()->metaObject; } + static const QQmlPropertyData *resolveOverloaded( + const QQmlObjectOrGadget &object, const QQmlPropertyData *methods, int methodCount, + ExecutionEngine *engine, CallData *callArgs); -protected: - static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); - static bool virtualIsEqualTo(Managed *a, Managed *b); + static const QQmlPropertyData *resolveOverloaded( + const QQmlPropertyData *methods, int methodCount, + void **argv, int argc, const QMetaType *types); -private: - void init(ExecutionEngine *engine); - ReturnedValue constructInternal(const Value *argv, int argc) const; + static ReturnedValue callPrecise( + const QQmlObjectOrGadget &object, const QQmlPropertyData &data, + ExecutionEngine *engine, CallData *callArgs, + QMetaObject::Call callType = QMetaObject::InvokeMetaMethod); }; struct Q_QML_EXPORT QmlSignalHandler : public QV4::Object -- cgit v1.2.3