diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-02-13 14:44:38 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-13 13:26:02 +0100 |
commit | f6d0c67d30ef1c22b086641e8d1288e1baaa1663 (patch) | |
tree | fae2d2285e9dbdc3163a59e388cccda07f07578f /src/corelib/io/qdebug.h | |
parent | 1f4cda9a70dd8b1fbabe716de26cace85f3aef41 (diff) |
QDebug: Allow text stream formatting for 64 bit numbers
Use the QTextStream stream operator for formatting 64 bit numbers,
just like we do for other numbers, too. This ensures all numbers in
a QDebug stream e.g. respect the hex and showbase modifiers.
The original reason for formatting qin64, quint64 with QString::number
is unclear (pre-dates the original qt4 git import). Maybe QTextStream
did lack proper support for 64 bit numbers back then.
Task-number: QTBUG-36841
Change-Id: I049516c2a8394c9c1a708f86c3d950418a20a957
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r-- | src/corelib/io/qdebug.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 00177b659e..bdaaa05768 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -110,10 +110,8 @@ public: inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); } inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); } inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); } - inline QDebug &operator<<(qint64 t) - { stream->ts << QString::number(t); return maybeSpace(); } - inline QDebug &operator<<(quint64 t) - { stream->ts << QString::number(t); return maybeSpace(); } + inline QDebug &operator<<(qint64 t) { stream->ts << t; return maybeSpace(); } + inline QDebug &operator<<(quint64 t) { stream->ts << t; return maybeSpace(); } inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); } inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); } inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); } |