From 4fb0ca420954e48494e501bdce518c87346af656 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 20 Jun 2014 14:46:42 +0200 Subject: QDebug: Add a doc section about formatting options Change-Id: I43cb965f9f45e8a50c767c7e9035811c90e6aab3 Reviewed-by: Alex Blasche --- src/corelib/io/qdebug.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index ef9c654266..56c46d69c9 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -79,6 +79,18 @@ QT_BEGIN_NAMESPACE used to write debugging information to files and other devices. The constructor that accepts a QString is used to write to a string for display or serialization. + \section1 Formatting Options + + QDebug formats output so that it's easily readable. It automatically adds spaces + between arguments, and adds quotes around QString, QByteArray, QChar arguments. + + You can tweak these options through the space(), nospace() and quote(), noquote() + methods. Furthermore, \l{QTextStream manipulators} can be piped into a QDebug + stream. + + QDebugStateSaver limits changes to the formatting to the current scope. + resetFormat() resets the options to the default ones. + \section1 Writing Custom Types to a Stream Many standard types can be written to QDebug objects, and Qt provides support for -- cgit v1.2.3