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>
This commit is contained in:
parent
86bb62f2e7
commit
73dbc1fdf6
@ -166,7 +166,7 @@ static inline int typeFromTypeInfo(const QMetaObject *mo, uint typeInfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class QMetaMethodPrivate : public QMetaMethod
|
class QMetaMethodPrivate : public QMetaMethodInvoker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const QMetaMethodPrivate *get(const QMetaMethod *q)
|
static const QMetaMethodPrivate *get(const QMetaMethod *q)
|
||||||
@ -191,31 +191,6 @@ public:
|
|||||||
inline int ownMethodIndex() const;
|
inline int ownMethodIndex() const;
|
||||||
inline int ownConstructorMethodIndex() 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:
|
private:
|
||||||
QMetaMethodPrivate();
|
QMetaMethodPrivate();
|
||||||
};
|
};
|
||||||
@ -2411,7 +2386,7 @@ bool QMetaMethod::invoke(QObject *object,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto QMetaMethodPrivate::invokeImpl(QMetaMethod self, void *target,
|
auto QMetaMethodInvoker::invokeImpl(QMetaMethod self, void *target,
|
||||||
Qt::ConnectionType connectionType,
|
Qt::ConnectionType connectionType,
|
||||||
qsizetype paramCount, const void *const *parameters,
|
qsizetype paramCount, const void *const *parameters,
|
||||||
const char *const *typeNames) -> InvokeFailReason
|
const char *const *typeNames) -> InvokeFailReason
|
||||||
|
@ -132,6 +132,36 @@ Q_DECLARE_TYPEINFO(QArgumentType, Q_RELOCATABLE_TYPE);
|
|||||||
typedef QVarLengthArray<QArgumentType, 10> QArgumentTypeArray;
|
typedef QVarLengthArray<QArgumentType, 10> QArgumentTypeArray;
|
||||||
|
|
||||||
namespace { class QMetaMethodPrivate; }
|
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
|
struct QMetaObjectPrivate
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user