diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-07-22 08:41:17 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-07-23 13:13:04 +0200 |
commit | 7aae6219d578b4d8ca8f97d67136b946fc25f5d6 (patch) | |
tree | 009928f210402de667b3548195c3d1713d7016b5 /src/gui/image/qicon.cpp | |
parent | b5b4eb742c9e392a73f81c403d020f23e021f04a (diff) |
Keep global state of debug stream (QImage, QPixmap, and QIcon)
Make sure that the stream's formatting settings are preserved.
Change-Id: Ib13b5e0b36b2ef801da2d2d5c240d28dc1b04653
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/image/qicon.cpp')
-rw-r--r-- | src/gui/image/qicon.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 4f5e9c3d1f..ac95222c99 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -1321,18 +1321,20 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QIcon &i) { - QDebug nospace = dbg.nospace(); - nospace << "QIcon("; + QDebugStateSaver saver(dbg); + dbg.resetFormat(); + dbg.nospace(); + dbg << "QIcon("; if (i.isNull()) { - nospace << "null"; + dbg << "null"; } else { if (!i.name().isEmpty()) - nospace << i.name() << ','; - nospace << "availableSizes[normal,Off]=" << i.availableSizes() + dbg << i.name() << ','; + dbg << "availableSizes[normal,Off]=" << i.availableSizes() << ",cacheKey=" << showbase << hex << i.cacheKey() << dec << noshowbase; } - nospace << ')'; - return dbg.space(); + dbg << ')'; + return dbg; } #endif |