diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-02-14 10:05:34 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-03-09 14:56:35 +0000 |
commit | ef26467eb21c5282dcad53c4da109d99ff4395aa (patch) | |
tree | 28156259d31f35f03ac840af7c6cbd4f32698ba8 /doc/global/qt-cpp-defines.qdocconf | |
parent | f8218637e9e5fa8f50ef25da293b95f767eaefc2 (diff) |
Reintroduce a directed QMetaType::typeName array
Commit fb376e0fcc8d2d0a1731a588bfc6497d05e090e6 removed an array that
facilitated returning the names of built-in types, to avoid the jump tables
from the switch statement. This commit brings it back but makes the array a
compile-time constant string offset table.
The array is created by way of a set of C++11 constexpr functions, so we
require that compiler feature. I've tested that MSVC 2015 does support
it as well as the ICC 17 when masquerading as MSVC 2015, so I've enabled
for that too. The only compiler left out is MSVC 2013.
If we didn't need to support MSVC 2015, this could have been written
more simply with C++14 relaxed constexpr.
This also adds unit tests to confirm that QMetaType::typeName() does
return null when we said it would. We're testing QMetaType::User-1
(which we'll likely never use) and QMetaType::LastWidgetsType-1 to
select something inside the range of the built-in types.
Task-number: QTBUG-58851
Change-Id: I4139d5f93dcb4b429ae9fffd14a33982891e2ac1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'doc/global/qt-cpp-defines.qdocconf')
0 files changed, 0 insertions, 0 deletions