Go to file
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
bin Fix qtmodule-configtests to honor error codes 2012-03-08 23:52:34 +01:00
config.tests arch: Undefine possible architecture defines 2012-03-16 06:12:00 +01:00
dist QMetaMethod::typeName() should return "void" if the return type is void 2012-03-21 18:55:51 +01:00
doc/src QRegularExpression: support for QStringList overloads 2012-03-21 11:43:30 +01:00
examples Remove all QWS centric examples 2012-03-15 15:18:16 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Install fonts when not using fontconfig 2012-03-16 21:30:59 +01:00
qmake Merge master into api_changes 2012-03-19 10:03:48 +01:00
src QMetaMethod::typeName() should return "void" if the return type is void 2012-03-21 18:55:51 +01:00
tests QMetaMethod::typeName() should return "void" if the return type is void 2012-03-21 18:55:51 +01:00
tools Merge master into api_changes 2012-03-19 10:03:48 +01:00
util clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add bin/qdoc to .gitignore 2012-03-14 09:45:07 +01:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Fix cross-compilation of qdbus bootstrapped tools. 2012-03-20 22:20:25 +01:00
configure.bat Remove Q_BYTE_ORDER and -*-endian arguments from configures 2012-03-02 14:48:00 +01:00
header.BSD Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.FDL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL-ONLY Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
INSTALL Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Update contact information in license headers. 2012-01-23 04:04:33 +01:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro remove obviously counterproductive uses of QT_SOURCE_TREE & QT_BUILD_TREE 2012-03-08 18:57:13 +01:00
sync.profile Add qprocessordetection.h 2012-02-08 12:33:11 +01:00