Marc Mutz afdf37ad8f QMetaObject: deprecate the Qt 6 QVector -> QList porting kludge
The argumentTypesFromString() function is clearly documented not to
perform any normalization, yet in typical Qt 6.0 porting rush, it did,
and this kludge was never removed.

Do it now; it's in the way of porting QArgumentType from QBA to QBAV,
and it's causing correct code to incorrectly fail.

This, however, changes the behavior of QMetaObject::indexOf*(), because
they don't fall back to normalization (indeed, these functions are used
as isNormalized checks, e.g. in connect()). So we can't remove the
kludge just yet, but we can drag it out of the fast path and re-try
with QVector replaced by QList when nothing was found using the
original signature. This way, we only pessimize unported users (and
calls that would have failed for other reasons, by scanning for
"QVector<" in the signature).

Add a qWarning() that we'll remove this behavior going forward.

It does, however, fix the bug that signals and slots that contain
types that match, but are not, "QVector<", fail to be found by the
machinery:

[ChangeLog][QtCore][QMetaObject/QObject] Fixed a bug that caused
signals and slots with argument types matching "QVector<"
(e.g. "MyQVector<int>" or "NotQt::QVector<int>") to not be found in
QObject::connect() or QMetaObject::indexOfMethod().

[ChangeLog][Deprecation Notices][QMetaObject] The
indexOf{Constructor,Slot,Signal,Method}() functions are documented to
require input according to QMetaObject::normalizedSignature(), but
accepted a QList declared as QVector. This was an internal porting aid
and is being deprecated now. Watch out for runtime warnings about this.
QObject::connect() and QMetaObject::invokeMethod() are unaffected, as
they fall back to normalizeSignature() automatically.

No change in tst_bench_qobject connect performance, which is
unsurprising, as the benchmark doesn't use a QVector alias.

Amends 03326a2fec416405b437089874f6439e937bbada.

Task-number: QTBUG-135572
Pick-to: 6.10
Change-Id: I7fd9293bba5d2b57b4452e55499ffbf360bc6123
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-06-12 16:03:50 +00:00
2024-11-05 14:36:16 +01:00
2025-06-05 00:07:53 +01:00
2025-03-24 23:19:04 +01:00
2025-04-09 13:49:11 +02:00
2024-06-25 11:44:00 +02:00
2025-05-25 23:09:56 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%