summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-01 17:09:45 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-07 17:21:38 +0000
commit4d17db19f895ddaa778120c346d8a6a33a710194 (patch)
tree5c931f662f4a793cb82fb5f2099f595990e25437 /examples
parent9fccf8064dea35f324f822b30116828acc3855a9 (diff)
Fix debug stream operators.
- Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants, streamline code. Change-Id: I18ae7324b172ea801aa9b5fe56ddf6fe527fdde9 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/video/qmlvideo/trace.h5
-rw-r--r--examples/multimedia/video/qmlvideofx/trace.h5
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/multimedia/video/qmlvideo/trace.h b/examples/multimedia/video/qmlvideo/trace.h
index 3bfb1d799..02ba64769 100644
--- a/examples/multimedia/video/qmlvideo/trace.h
+++ b/examples/multimedia/video/qmlvideo/trace.h
@@ -62,8 +62,9 @@ struct PtrWrapper
template <typename T>
inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
{
- debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
- return debug.space();
+ QDebugStateSaver saver(debug);
+ debug.nospace() << '[' << static_cast<const void *>(wrapper.m_ptr) << ']';
+ return debug;
}
template<typename T>
diff --git a/examples/multimedia/video/qmlvideofx/trace.h b/examples/multimedia/video/qmlvideofx/trace.h
index 86e46b33e..b251deb3d 100644
--- a/examples/multimedia/video/qmlvideofx/trace.h
+++ b/examples/multimedia/video/qmlvideofx/trace.h
@@ -62,8 +62,9 @@ struct PtrWrapper
template <typename T>
inline QDebug &operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
{
- debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
- return debug.space();
+ QDebugStateSaver saver(debug);
+ debug.nospace() << '[' << static_cast<const void *>(wrapper.m_ptr) << ']';
+ return debug;
}
#ifdef ENABLE_TRACE