QMetaCallEvent::create: pass arguments by const ref

Amends 4d7ae8a74e70896a757f483865fe7095120fedc1.

Pick-to: 6.6
Change-Id: Id4379324c2399f2360b3553d297f38dd793af21c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Volker Hilsheimer 2023-06-09 23:41:36 +02:00
parent 1f22fc995a
commit 38a00d2c97

View File

@ -389,14 +389,14 @@ public:
template<typename ...Args>
static QMetaCallEvent *create(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender,
int signal_index, Args ...argv)
int signal_index, const Args &...argv)
{
auto metaCallEvent = std::make_unique<QMetaCallEvent>(slotObj, sender,
signal_index, int(1 + sizeof...(Args)));
void **args = metaCallEvent->args();
QMetaType *types = metaCallEvent->types();
const std::array<void *, sizeof...(Args) + 1> argp{ nullptr, std::addressof(argv)... };
const std::array<const void *, sizeof...(Args) + 1> argp{ nullptr, std::addressof(argv)... };
const std::array metaTypes{ QMetaType::fromType<void>(), QMetaType::fromType<Args>()... };
for (size_t i = 0; i < sizeof...(Args) + 1; ++i) {
types[i] = metaTypes[i];