path: root/src/widgets/kernel/qgesturemanager.cpp
diff options
authorMarc Mutz <>2015-10-24 22:31:27 +0200
committerMarc Mutz <>2016-05-03 04:35:06 +0000
commit5a76a3fb03f8d1dc8cb367de1a1dc6a37048376a (patch)
tree2328d894da121bd0912cb9777f6254cc62296946 /src/widgets/kernel/qgesturemanager.cpp
parent0eaac0a3a95f8a74c06d062d3aa7928cbb09d493 (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 <>
Diffstat (limited to 'src/widgets/kernel/qgesturemanager.cpp')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 8af3516d4b..777be8525e 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -75,7 +75,7 @@ static inline int panTouchPoints()
const int result = qEnvironmentVariableIntValue(panTouchPointVariable, &ok);
if (ok && result >= 1)
return result;
- qWarning() << "Ignoring invalid value of " << panTouchPointVariable;
+ qWarning("Ignoring invalid value of %s", panTouchPointVariable);
// Pan should use 1 finger on a touch screen and 2 fingers on touch pads etc.
// where 1 finger movements are used for mouse event synthetization. For now,