From 6f5cdac6b6fec6b217629b0bf3e217e81384f39c Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 2 Oct 2025 18:07:31 +0300 Subject: QObject: take by QSpan in static helper function Instead of passing by a pointer and length. Pick-to: 6.10 Change-Id: I591f67a1af0ef10af9456adc009f21eb2cc6a1a3 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel/qobject.cpp') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a7afc08a345..41004e6f30e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -104,8 +104,9 @@ static int *queuedConnectionTypes(const QMetaMethod &method) } // ### Future work: replace with an array of QMetaType or QtPrivate::QMetaTypeInterface * -static int *queuedConnectionTypes(const QArgumentType *argumentTypes, int argc) +static int *queuedConnectionTypes(QSpan argumentTypes) { + const int argc = int(argumentTypes.size()); auto types = std::make_unique(argc + 1); for (int i = 0; i < argc; ++i) { const QArgumentType &type = argumentTypes[i]; @@ -3154,8 +3155,7 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const char *sign // ### Future work: attempt get the metatypes from the meta object first // because it's possible they're all registered. int *types = nullptr; - if ((type == Qt::QueuedConnection) - && !(types = queuedConnectionTypes(signalTypes.constData(), signalTypes.size()))) { + if (type == Qt::QueuedConnection && !(types = queuedConnectionTypes(signalTypes))) { return QMetaObject::Connection(nullptr); } -- cgit v1.2.3