summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2025-10-02 18:07:31 +0300
committerAhmad Samir <a.samirh78@gmail.com>2025-10-06 10:39:11 +0300
commit6f5cdac6b6fec6b217629b0bf3e217e81384f39c (patch)
tree397c4781a83243cd0e7e40cb9dd5b7d96c50dfd4 /src/corelib/kernel
parent0f77938ede82e60acc88e0575db09f250d749f14 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp6
1 files changed, 3 insertions, 3 deletions
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<const QArgumentType> argumentTypes)
{
+ const int argc = int(argumentTypes.size());
auto types = std::make_unique<int[]>(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);
}