summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-07-22 08:41:17 +0200
committerKai Koehne <kai.koehne@digia.com>2014-07-23 13:13:04 +0200
commit7aae6219d578b4d8ca8f97d67136b946fc25f5d6 (patch)
tree009928f210402de667b3548195c3d1713d7016b5 /src/gui/image/qimage.cpp
parentb5b4eb742c9e392a73f81c403d020f23e021f04a (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/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 40f8b9e4d8..8c7c446e96 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.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.
@@ -4550,19 +4550,21 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QImage &i)
{
- QDebug nospace = dbg.nospace();
- nospace << "QImage(";
+ QDebugStateSaver saver(dbg);
+ dbg.resetFormat();
+ dbg.nospace();
+ dbg << "QImage(";
if (i.isNull()) {
- nospace << "null";
+ dbg << "null";
} else {
- nospace << i.size() << ",format=" << i.format() << ",depth=" << i.depth();
+ dbg << i.size() << ",format=" << i.format() << ",depth=" << i.depth();
if (i.colorCount())
- nospace << ",colorCount=" << i.colorCount();
- nospace << ",devicePixelRatio=" << i.devicePixelRatio()
+ dbg << ",colorCount=" << i.colorCount();
+ dbg << ",devicePixelRatio=" << i.devicePixelRatio()
<< ",bytesPerLine=" << i.bytesPerLine() << ",byteCount=" << i.byteCount();
}
- nospace << ')';
- return dbg.space();
+ dbg << ')';
+ return dbg;
}
#endif