diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-24 22:31:27 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-05-03 04:35:06 +0000 |
commit | 5a76a3fb03f8d1dc8cb367de1a1dc6a37048376a (patch) | |
tree | 2328d894da121bd0912cb9777f6254cc62296946 /mkspecs/features/qt.prf | |
parent | 0eaac0a3a95f8a74c06d062d3aa7928cbb09d493 (diff) |
QtBase: use printf-style qWarning/qDebug where possible (II)
The printf-style version of QDebug expands to a lot less code than the
std::ostream-style version. Of course, you pay in type safety (but
compilers warn about it these days), you cannot stream complex Qt
types and streaming QStrings is awkward, but in many cases you
actually improve on readability.
But the main reason is that something that's not supposed to be
executed under normal operation has no business bloating executable
code size.
This is not an attempt at converting all qWarnings() to printf-style,
only the low-hanging fruit.
In this second part, replace
qWarning() << "" << non-QString
with
qWarning("..%.", non-QString).
QString (and QUrl etc) have special escaping handling when streamed
into QDebug, so leave those alone. They also seem to expand to less
code than the qPrintable() alternative, so there's no reason to
replace them.
Saves 2KiB, 3.4KiB, ~750b and ~450b in text size in QtCore, Gui,
Network and Widgets, resp., on optimized GCC 5.3 AMD64 builds.
Change-Id: Iae6823e543544347e628ca1060d6d51e3b04d3f4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'mkspecs/features/qt.prf')
0 files changed, 0 insertions, 0 deletions