From 29a7f5571cb3619898d8d05c09f7df4ece915aed Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 17 Oct 2015 17:48:34 +0200 Subject: QtWidgets: use printf-style qWarning/qDebug where possible (I) 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 first part, replace qWarning() << "..."; with qWarning("..."); Change-Id: I1f6869b024103c98262f1deae014e0d7337a541c Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/util/qflickgesture.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/widgets/util/qflickgesture.cpp') diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index 8eadc42625..c7e0861a0f 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -155,9 +155,9 @@ public: mouseTarget = QApplication::widgetAt(pressDelayEvent->globalPos()); mouseButton = pressDelayEvent->button(); mouseEventSource = pressDelayEvent->source(); - qFGDebug() << "QFG: consuming/delaying mouse press"; + qFGDebug("QFG: consuming/delaying mouse press"); } else { - qFGDebug() << "QFG: NOT consuming/delaying mouse press"; + qFGDebug("QFG: NOT consuming/delaying mouse press"); } e->setAccepted(true); } @@ -194,7 +194,7 @@ public: void scrollerWasIntercepted() { - qFGDebug() << "QFG: deleting delayed mouse press, since scroller was only intercepted"; + qFGDebug("QFG: deleting delayed mouse press, since scroller was only intercepted"); if (pressDelayEvent) { // we still haven't even sent the press, so just throw it away now if (pressDelayTimer) { @@ -210,7 +210,7 @@ public: { if (pressDelayEvent) { // we still haven't even sent the press, so just throw it away now - qFGDebug() << "QFG: deleting delayed mouse press, since scroller is active now"; + qFGDebug("QFG: deleting delayed mouse press, since scroller is active now"); if (pressDelayTimer) { killTimer(pressDelayTimer); pressDelayTimer = 0; -- cgit v1.2.3