Qt 4.8
|
The QDebug class provides an output stream for debugging information. More...
#include <qdebug.h>
Classes | |
struct | Stream |
Public Functions | |
QDebug & | maybeSpace () |
Writes a space character to the debug stream, depending on the last character sent to the stream, and returns a reference to the stream. More... | |
QDebug & | nospace () |
Clears the stream's internal flag that records whether the last character was a space and returns a reference to the stream. More... | |
QDebug & | operator<< (QChar t) |
Writes the character, t, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (QBool t) |
Writes the boolean value, t, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (bool t) |
Writes the boolean value, t, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (char t) |
Writes the character, t, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (signed short t) |
Writes the signed short integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (unsigned short t) |
Writes then unsigned short integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (signed int t) |
Writes the signed integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (unsigned int t) |
Writes then unsigned integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (signed long t) |
Writes the signed long integer, l, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (unsigned long t) |
Writes then unsigned long integer, l, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (qint64 t) |
Writes the signed 64-bit integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (quint64 t) |
Writes then unsigned 64-bit integer, i, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (float t) |
Writes the 32-bit floating point number, f, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (double t) |
Writes the 64-bit floating point number, f, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const char *t) |
Writes the '\0'-terminated string, s, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const QString &t) |
Writes the string, s, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const QStringRef &t) |
Writes the string reference, s, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const QLatin1String &t) |
Writes the Latin1-encoded string, s, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const QByteArray &t) |
Writes the byte array, b, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (const void *t) |
Writes a pointer, p, to the stream and returns a reference to the stream. More... | |
QDebug & | operator<< (QTextStreamFunction f) |
QDebug & | operator<< (QTextStreamManipulator m) |
QDebug & | operator= (const QDebug &other) |
Assigns the other debug stream to this stream and returns a reference to this stream. More... | |
QDebug (QIODevice *device) | |
Constructs a debug stream that writes to the given device. More... | |
QDebug (QString *string) | |
Constructs a debug stream that writes to the given string. More... | |
QDebug (QtMsgType t) | |
Constructs a debug stream that writes to the handler for the message type specified by type. More... | |
QDebug (const QDebug &o) | |
Constructs a copy of the other debug stream. More... | |
QDebug & | space () |
Writes a space character to the debug stream and returns a reference to the stream. More... | |
~QDebug () | |
Flushes any pending data to be written and destroys the debug stream. More... | |
Properties | |
struct QDebug::Stream * | stream |
The QDebug class provides an output stream for debugging information.
QDebug is used whenever the developer needs to write out debugging or tracing information to a device, file, string or console.
In the common case, it is useful to call the qDebug() function to obtain a default QDebug object to use for writing debugging information.
This constructs a QDebug object using the constructor that accepts a QtMsgType value of QtDebugMsg. Similarly, the qWarning(), qCritical() and qFatal() functions also return QDebug objects for the corresponding message types.
The class also provides several constructors for other situations, including a constructor that accepts a QFile or any other QIODevice subclass that is 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.
Many standard types can be written to QDebug objects, and Qt provides support for most Qt value types. To add support for custom types, you need to implement a streaming operator, as in the following example:
This is described in the Debugging Techniques and Creating Custom Qt Types::Making the Type Printable{Creating Custom Qt Types} documents.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Flushes any pending data to be written and destroys the debug stream.
Definition at line 81 of file qdebug.h.
|
inline |
Writes a space character to the debug stream, depending on the last character sent to the stream, and returns a reference to the stream.
If the last character was a space character, this function writes a space character to the stream; otherwise, no characters are written to the stream.
Definition at line 93 of file qdebug.h.
Referenced by operator<<().
|
inline |
Clears the stream's internal flag that records whether the last character was a space and returns a reference to the stream.
Definition at line 92 of file qdebug.h.
Referenced by debugVariantList(), flagsDebug(), operator<<(), QDeclarativeInfo::QDeclarativeInfo(), and streamDebug().
Writes the character, t, to the stream and returns a reference to the stream.
Definition at line 95 of file qdebug.h.
Referenced by QDeclarativeInfo::operator<<().
Writes the boolean value, t, to the stream and returns a reference to the stream.
Definition at line 96 of file qdebug.h.
|
inline |
Writes the boolean value, t, to the stream and returns a reference to the stream.
Definition at line 97 of file qdebug.h.
|
inline |
Writes the character, t, to the stream and returns a reference to the stream.
Definition at line 98 of file qdebug.h.
|
inline |
Writes the signed short integer, i, to the stream and returns a reference to the stream.
Definition at line 99 of file qdebug.h.
|
inline |
Writes then unsigned short integer, i, to the stream and returns a reference to the stream.
Definition at line 100 of file qdebug.h.
|
inline |
Writes the signed integer, i, to the stream and returns a reference to the stream.
Definition at line 101 of file qdebug.h.
|
inline |
Writes then unsigned integer, i, to the stream and returns a reference to the stream.
Definition at line 102 of file qdebug.h.
|
inline |
Writes the signed long integer, l, to the stream and returns a reference to the stream.
Definition at line 103 of file qdebug.h.
|
inline |
Writes then unsigned long integer, l, to the stream and returns a reference to the stream.
Definition at line 104 of file qdebug.h.
Writes the signed 64-bit integer, i, to the stream and returns a reference to the stream.
Definition at line 105 of file qdebug.h.
Writes then unsigned 64-bit integer, i, to the stream and returns a reference to the stream.
Definition at line 107 of file qdebug.h.
|
inline |
Writes the 32-bit floating point number, f, to the stream and returns a reference to the stream.
Definition at line 109 of file qdebug.h.
|
inline |
Writes the 64-bit floating point number, f, to the stream and returns a reference to the stream.
Definition at line 110 of file qdebug.h.
|
inline |
Writes the '\0'-terminated string, s, to the stream and returns a reference to the stream.
Definition at line 111 of file qdebug.h.
Writes the string, s, to the stream and returns a reference to the stream.
Definition at line 112 of file qdebug.h.
|
inline |
Writes the string reference, s, to the stream and returns a reference to the stream.
Definition at line 113 of file qdebug.h.
Referenced by operator<<().
|
inline |
Writes the Latin1-encoded string, s, to the stream and returns a reference to the stream.
Definition at line 114 of file qdebug.h.
|
inline |
Writes the byte array, b, to the stream and returns a reference to the stream.
Definition at line 115 of file qdebug.h.
|
inline |
Writes a pointer, p, to the stream and returns a reference to the stream.
Definition at line 116 of file qdebug.h.
|
inline |
|
inline |
|
inline |
Writes a space character to the debug stream and returns a reference to the stream.
The stream will record that the last character sent to the stream was a space.
Definition at line 91 of file qdebug.h.
Referenced by operator<<().
|
private |
Referenced by operator=().