qt5base-lts/tests/auto/corelib
Giuseppe D'Angelo c0637c0298 QObject::connect: allow to disable narrowing of the connection arguments
One of the good features of the new connection style is that
implicit conversion is performed for the connection arguments.

However, this is also a bad feature when it comes to the old
C remnants in the C++ language: for instance, doubles implicitly
convert to ints, possibly losing precision (and GCC/Clang do not
even warn about those under -Wall, only MSVC does) or even
triggering undefined behavior.

For this reason, when using braced initialization, C++11
disables narrowing conversions or floating/integral conversions.
Use this feature when checking the arguments of a PMF-style
signal/slot connection. Technically this makes the program
ill-formed, however GCC still accepts it (but at least
warns under -Wall).

Hence, add a way to disable these implicit conversions.
This is a opt-in and guarded by a macro, as it's a source
incompatible change.

[ChangeLog][QtCore][QObject] The
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT macro has been added.
When using the new connection syntax (PMF-based) this macro
makes it illegal to narrow the arguments carried by the signal,
and/or to perform floating point to integral implicit
conversions on them. When the macro is defined,
depending on your compiler a QObject::connect() statement
triggering such conversions will now fail to compile.

Change-Id: Ie17eb3e66ce0cd780138e60d8bb7da815a4ada83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-02 23:03:15 +00:00
..
animation QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
codecs QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
global Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
io Merge remote-tracking branch 'origin/5.7' into dev 2016-08-01 18:20:00 +02:00
itemmodels QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
json Handle QVariantHash in QJsonDocument::fromVariant 2016-07-13 10:58:02 +00:00
kernel QObject::connect: allow to disable narrowing of the connection arguments 2016-08-02 23:03:15 +00:00
mimetypes Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code 2016-07-06 06:28:13 +00:00
plugin Merge remote-tracking branch 'origin/5.7' into dev 2016-06-13 12:46:46 +02:00
statemachine Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
thread Q(Basic)Mutex: add try_lock{,_for,_until} for STL compatibility 2016-07-25 13:10:07 +00:00
tools Merge remote-tracking branch 'origin/5.7' into dev 2016-08-01 18:20:00 +02:00
xml Merge remote-tracking branch 'origin/5.6' into 5.7 2016-07-26 10:43:29 +02:00
corelib.pro Add support for Apple tvOS 2016-05-17 16:11:23 +00:00