diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-15 19:01:00 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-09-01 21:29:04 -0300 |
commit | 0380dd50519e4e1eb5ba5e8f54e858e1d84a1d2f (patch) | |
tree | 3b167ececc698382fc3e673fbf5bcd2358cc09b6 /src/corelib/kernel/qmetaobject.h | |
parent | ba8c4b4ac6df8c4318e3dd8c886aa0135628d33c (diff) |
QMetaObject: pass the QMetaTypes in variadic invoke/newInstance
[ChangeLog][QtCore][Meta Object] QMetaMethod::invoke(),
QMetaObject::invokeMethod(), and QMetaObject::newInstance() are no
longer limited to 10 arguments.
[ChangeLog][QtCore][Meta Object] The use of the Q_ARG macro is no longer
necessary when using QMetaMethod::invoke(), QMetaObject::invokeMethod(),
and QMetaObject::newInstance(). Types may now be passed
directly. Similarly, Q_RETURN_ARG can be replaced by the free function
qReturnArg().
[ChangeLog][Potentially Source-Incompatible Changes]
QMetaMethod::invoke(), QMetaObject::invokeMethod(), and
QMetaObject::newInstance() no longer support passing forward-declared
types in the argument list (it was possible to pass them by
const-ref). From Qt 6.5 onwards, all types in the argument list must be
fully defined.
[ChangeLog][Potentially Source-Incompatible Changes] Attempting to use
the internal types QArgument, QReturnArgument, QGenericArgument, or
QGenericReturnArgument directly with QMetaMethod::invoke(),
QMetaObject::invokeMethod() or QMetaObject::newInstance() may fail to
compile. Those are internal types that were never meant to be used
directly and will be removed in Qt 7. If really necessary, ensure all
arguments passed to those functions are directly using those classes and
not mixed with Q_ARG and Q_RETURN_ARG. Implementations of bindings to
other languages should contact the Qt development mailing list to
discuss options.
Change-Id: I36b24183fbd041179f2ffffd1701e3e8e47e0fba
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.h')
-rw-r--r-- | src/corelib/kernel/qmetaobject.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 735f26caa2..c7cee536a6 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -141,7 +141,7 @@ public: { auto h = QtPrivate::invokeMethodHelper(r, std::forward<Args>(arguments)...); return invokeImpl(*this, obj, c, h.parameterCount(), h.parameters.data(), - h.typeNames.data()); + h.typeNames.data(), h.metaTypes.data()); } template <typename... Args> QtPrivate::Invoke::IfNotOldStyleArgs<bool, Args...> @@ -167,7 +167,7 @@ public: { auto h = QtPrivate::invokeMethodHelper(r, std::forward<Args>(arguments)...); return invokeImpl(*this, gadget, Qt::ConnectionType(-1), h.parameterCount(), - h.parameters.data(), h.typeNames.data()); + h.parameters.data(), h.typeNames.data(), h.metaTypes.data()); } template <typename... Args> QtPrivate::Invoke::IfNotOldStyleArgs<bool, Args...> @@ -190,7 +190,8 @@ public: private: static bool invokeImpl(QMetaMethod self, void *target, Qt::ConnectionType, qsizetype paramCount, - const void *const *parameters, const char *const *typeNames); + const void *const *parameters, const char *const *typeNames, + const QtPrivate::QMetaTypeInterface *const *metaTypes); static QMetaMethod fromSignalImpl(const QMetaObject *, void **); static QMetaMethod fromRelativeMethodIndex(const QMetaObject *mobj, int index); static QMetaMethod fromRelativeConstructorIndex(const QMetaObject *mobj, int index); |