qt5base-lts/tests/auto
Kent Hansen 74c3517e6a Fix regression in connectNotify(const char *) emission
Reimplementations of connectNotify() and disconnectNotify() can
assume that the signal argument is in normalized form, but after the
introduction of the Qt5 meta-object format, it could happen that it's
not.

The problem is that the internal QArgumentType class, which attempts
to resolve a typename to a type id, was calling QMetaType::type().
QMetaType::type() falls back to trying the normalized form of the
typename if the original argument can't be resolved as a type (this
behavior isn't documented, but that's how it works). This means that
e.g. QMetaType::type("const QString &") returns QMetaType::QString.

Since QMetaObjectPrivate::indexOfMethodRelative() (more specifically,
the methodMatch() helper function) prefers to compare type ids
over typenames (since the type ids are stored directly in the meta-
object data for built-in types), the method lookup would *succeed*
for signatures with non-normalized built-in typenames as parameters.
QObject::connect() would then think that it did not have to
normalize the signature (see "// check for normalized signatures").
The consequence was that the original, non-normalized form got
passed to connectNotify().

This commit introduces an internal typename-to-type function that
is the same as QMetaType::type(), except it doesn't try to normalize
the name. This way, the only place where normalization can occur in
the signature-to-meta-method processing is through the calls to
QMetaObject::normalizedSignature() in QObject::connect() itself.

The implication is that there are now cases where the method
signature will be decoded and processed twice, where processing it
once was sufficient before. On the other hand, it is consistent with
the pre-Qt5-meta-object behavior, where we predict that the
signature is already normalized, and only perform (comparatively
costly) normalization if the initial lookup fails.

Change-Id: Ie6b60f60b0f9a57ebd378d980329dac62d57bbd9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-01 20:03:28 +02:00
..
cmake Never attempt to run the dbus tests on APPLE. 2012-05-01 07:10:23 +02:00
compilerwarnings/data Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
concurrent Remove insignification from QtConcurrentFilter test. 2012-04-19 13:26:51 +02:00
corelib Fix regression in connectNotify(const char *) emission 2012-05-01 20:03:28 +02:00
dbus Finish cleaning up com.trolltech -> org.qtproject in QtDBus 2012-04-16 00:07:39 +02:00
gui Removed insignification from QBackingStore test 2012-04-30 11:37:36 +02:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
network Remove insignification from qsslsocket_onDemandCertificates_* tests 2012-04-30 01:08:09 +02:00
opengl Re-enable QGLThreads autotest on Mac OS X. 2012-04-19 13:26:51 +02:00
other Temporarily disable -Woverloaded-virtual in headersclean test 2012-05-01 01:18:03 +02:00
printsupport Re-enable QPrinterInfo test on Mac OS X. 2012-04-19 04:13:04 +02:00
shared Added some convenience API for platform input contexts 2012-04-01 20:13:51 +02:00
sql QSqlQueryModel::setQuery() don't use deprecated reset() 2012-04-23 19:20:19 +02:00
testlib Merge remote-tracking branch 'origin/master' into api_changes 2012-04-10 15:31:45 +02:00
tools Remove QMetaObjectExtraData and put everything into QMetaObject 2012-04-25 20:19:29 +02:00
widgets Remove insignficiation from qgraphicsscene test on Windows. 2012-04-30 03:29:52 +02:00
xml Merge remote-tracking branch 'origin/master' into api_changes 2012-04-16 12:04:34 +02:00
auto.pro Re-enable network tests on Mac OS. 2012-04-24 16:06:28 +02:00
network-settings.h Don't require exact IMAP server version in autotests 2012-04-03 12:45:46 +02:00
platformquirks.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
test.pl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00