qt5base-lts/tests/auto
Kent Hansen 22d621dd99 QMetaMethod::typeName() should return "void" if the return type is void
QMetaMethod::typeName() is documented to return an empty string if
the return type is void. But after the introduction of
QMetaType::UnknownType (where void was made a distinct type),
returning an empty string causes the idiom

   QMetaType::type(method.typeName())

to break; the result will be QMetaType::UnknownType rather than
the expected QMetaType::Void for methods that return void.

New code should use the new function QMetaMethod::returnType()
instead, but it would be good if existing code still did the right
thing.

The consequence of returning "void" instead of an empty string is
that it breaks existing logic that uses the typeName() length to
determine whether a method returns void. But we judge this as the
lesser of the two evils; it's better to have a typeName() function
that is consistent and keeps the QMetaType::type(method.typeName())
idiom working, than to force the typeName() inconsistency for void
only to keep code that does "strlen(method.typeName()) == 0"
working.

The places in Qt that were relying on a zero-length typeName()
(testlib, dbus, declarative) have already been changed to use
returnType().

Also adapt QMetaObjectBuilder, which is internal API.

Change-Id: I70249174029811c5b5d2a08c24b6db33b3723d19
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 18:55:51 +01:00
..
bic Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
compilerwarnings/data Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
concurrent Remove commented code from qtconcurrentmap autotest. 2012-03-14 07:51:45 +01:00
corelib QMetaMethod::typeName() should return "void" if the return type is void 2012-03-21 18:55:51 +01:00
dbus QtDBus: make some constructors explicit 2012-03-12 15:22:30 +01:00
gui Merge master into api_changes 2012-03-19 10:03:48 +01:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
network Fix QDnsLookup autotest failure in CI environment 2012-03-15 18:05:05 +01:00
opengl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
other Make copy and assign private for QAccessibleEvent. 2012-03-18 21:42:38 +01:00
printsupport Move tst_qprinter.cpp to QtPrintSupport 2012-03-12 13:14:05 +01:00
shared Refactor input context tests 2012-02-22 13:54:13 +01:00
sql QSqlTableModel::removeRows() enforce edit strategy 2012-03-15 15:35:43 +01:00
testlib testlib: Improve formatting of QCOMPARE failure messages. 2012-03-12 01:50:20 +01:00
tools Bootstrap qdbuscpp2xml. 2012-03-18 14:14:42 +01:00
widgets Merge master into api_changes 2012-03-16 10:01:29 +01:00
xml clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
auto.pro Revert "Disable 'check' target generation for network autotests for Windows." 2012-03-15 18:05:05 +01:00
network-settings.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01: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