diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-17 17:48:34 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-10-27 11:10:24 +0000 |
commit | 29a7f5571cb3619898d8d05c09f7df4ece915aed (patch) | |
tree | f8bfe9dfa683b71c829f14a32de3bd7491310680 /src/widgets/kernel/qwidget.cpp | |
parent | f8eeabcf5ca4615fcb3ed783dbd321f4998a7651 (diff) |
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 <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index a006246454..773471533e 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -12099,7 +12099,7 @@ QOpenGLContext *QWidgetPrivate::shareContext() const return 0; #else if (!extra || !extra->topextra || !extra->topextra->window) { - qWarning() << "Asking for share context for widget that does not have a window handle"; + qWarning("Asking for share context for widget that does not have a window handle"); return 0; } QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this); |