summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r--src/corelib/io/qdebug.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 2314b36bda..9a6abc1994 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -173,6 +173,24 @@ public:
inline QDebug &operator<<(QTextStreamManipulator m)
{ stream->ts << m; return *this; }
+
+ template <typename T>
+ static QString toString(const T &object)
+ {
+ QString buffer;
+ QDebug stream(&buffer);
+ stream << object;
+ return buffer;
+ }
+
+ template <typename T>
+ static QString toString(const T *object)
+ {
+ QString buffer;
+ QDebug stream(&buffer);
+ stream << object;
+ return buffer;
+ }
};
Q_DECLARE_SHARED(QDebug)