diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 7849bce771a..b584c403fe8 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -166,7 +166,7 @@ static inline int typeFromTypeInfo(const QMetaObject *mo, uint typeInfo) } namespace { -class QMetaMethodPrivate : public QMetaMethod +class QMetaMethodPrivate : public QMetaMethodInvoker { public: static const QMetaMethodPrivate *get(const QMetaMethod *q) @@ -191,31 +191,6 @@ public: inline int ownMethodIndex() const; inline int ownConstructorMethodIndex() const; - // shadows the public function - enum class InvokeFailReason : int { - // negative values mean a match was found but the invocation failed - // (and a warning has been printed) - ReturnTypeMismatch = -1, - DeadLockDetected = -2, - CallViaVirtualFailed = -3, // no warning - ConstructorCallOnObject = -4, - ConstructorCallWithoutResult = -5, - ConstructorCallFailed = -6, // no warning - - CouldNotQueueParameter = -0x1000, - - // zero is success - None = 0, - - // positive values mean the parameters did not match - TooFewArguments, - FormalParameterMismatch = 0x1000, - }; - - static InvokeFailReason - invokeImpl(QMetaMethod self, void *target, Qt::ConnectionType, qsizetype paramCount, - const void *const *parameters, const char *const *typeNames); - private: QMetaMethodPrivate(); }; @@ -2411,7 +2386,7 @@ bool QMetaMethod::invoke(QObject *object, return false; } -auto QMetaMethodPrivate::invokeImpl(QMetaMethod self, void *target, +auto QMetaMethodInvoker::invokeImpl(QMetaMethod self, void *target, Qt::ConnectionType connectionType, qsizetype paramCount, const void *const *parameters, const char *const *typeNames) -> InvokeFailReason diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index d5fe6b535e9..d08c184d0b7 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -132,6 +132,36 @@ Q_DECLARE_TYPEINFO(QArgumentType, Q_RELOCATABLE_TYPE); typedef QVarLengthArray QArgumentTypeArray; namespace { class QMetaMethodPrivate; } +class QMetaMethodInvoker : public QMetaMethod +{ + QMetaMethodInvoker() = delete; + +public: + enum class InvokeFailReason : int { + // negative values mean a match was found but the invocation failed + // (and a warning has been printed) + ReturnTypeMismatch = -1, + DeadLockDetected = -2, + CallViaVirtualFailed = -3, // no warning + ConstructorCallOnObject = -4, + ConstructorCallWithoutResult = -5, + ConstructorCallFailed = -6, // no warning + + CouldNotQueueParameter = -0x1000, + + // zero is success + None = 0, + + // positive values mean the parameters did not match + TooFewArguments, + FormalParameterMismatch = 0x1000, + }; + + // shadows the public function + static InvokeFailReason Q_CORE_EXPORT + invokeImpl(QMetaMethod self, void *target, Qt::ConnectionType, qsizetype paramCount, + const void *const *parameters, const char *const *typeNames); +}; struct QMetaObjectPrivate {