diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-08-15 22:37:41 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-08-19 00:09:10 -0700 |
commit | 73dbc1fdf67dcc5e4f1a39830df6fdfd457a3404 (patch) | |
tree | ba04d3a17acf6a8141d62a3da54089381d32b964 /src/corelib | |
parent | 86bb62f2e7a0a0d1f4a3824f75826c0114526bf6 (diff) |
QMetaObject: export the invokeImpl inner method
For other modules that wrap invokeMethod and equivalent, like
qtwebchannel.
Task-number: QTBUG-105596
Change-Id: Ic6547f8247454b47baa8fffd170bbca806b04d8f
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 29 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject_p.h | 30 |
2 files changed, 32 insertions, 27 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 7849bce771..b584c403fe 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 d5fe6b535e..d08c184d0b 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<QArgumentType, 10> 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 { |