\sa setDevice()
*/
-
QDataStream::QDataStream()
: dev(nullptr),
owndev(false),
\sa setDevice(), device()
*/
-
QDataStream::QDataStream(QIODevice *device)
: dev(device),
owndev(false),
/*!
- \fn QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode mode)
-
Constructs a data stream that operates on a byte array, \a a. The
\a mode describes how the device is to be used.
Since QByteArray is not a QIODevice subclass, internally a QBuffer
is created to wrap the byte array.
*/
-
QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode flags)
: dev(nullptr),
owndev(true),
passed in the \e constructor, in which case the internal I/O device
is destroyed.
*/
-
QDataStream::~QDataStream()
{
if (owndev)
delete dev;
}
-
/*!
\fn QIODevice *QDataStream::device() const
\sa device()
*/
-
void QDataStream::setDevice(QIODevice *device)
{
if (owndev) {
}
/*!
- \fn bool QDataStream::atEnd() const
-
Returns true if the I/O device has reached the end position (end of
the stream or file) or if there is no I/O device set; otherwise
returns false.
\sa QIODevice::atEnd()
*/
-
bool QDataStream::atEnd() const
{
return dev ? dev->atEnd() : true;
\sa Status setStatus() resetStatus()
*/
-
QDataStream::DataStatus QDataStream::status() const
{
return q_status;
\sa byteOrder()
*/
-
void QDataStream::setByteOrder(ByteOrder bo)
{
byteorder = bo;
Reads a signed byte from the stream into \a i, and returns a
reference to the stream.
*/
-
QDataStream &QDataStream::operator>>(qint8 &i)
{
i = 0;
return *this;
}
-
/*!
\fn QDataStream &QDataStream::operator>>(quint16 &i)
\overload
Reads a signed 16-bit integer from the stream into \a i, and
returns a reference to the stream.
*/
-
QDataStream &QDataStream::operator>>(qint16 &i)
{
i = 0;
return *this;
}
-
/*!
\fn QDataStream &QDataStream::operator>>(quint32 &i)
\overload
Reads a signed 32-bit integer from the stream into \a i, and
returns a reference to the stream.
*/
-
QDataStream &QDataStream::operator>>(qint32 &i)
{
i = 0;
Reads a signed 64-bit integer from the stream into \a i, and
returns a reference to the stream.
*/
-
QDataStream &QDataStream::operator>>(qint64 &i)
{
i = qint64(0);
\sa setFloatingPointPrecision()
*/
-
QDataStream &QDataStream::operator>>(float &f)
{
if (floatingPointPrecision() == QDataStream::DoublePrecision) {
\sa setFloatingPointPrecision()
*/
-
QDataStream &QDataStream::operator>>(double &f)
{
if (floatingPointPrecision() == QDataStream::SinglePrecision) {
\sa QIODevice::read(), writeRawData()
*/
-
int QDataStream::readRawData(char *s, int len)
{
CHECK_STREAM_PRECOND(-1)
return *this;
}
-
/*!
\fn QDataStream &QDataStream::operator<<(quint16 i)
\overload
Writes a signed 16-bit integer, \a i, to the stream and returns a
reference to the stream.
*/
-
QDataStream &QDataStream::operator<<(qint16 i)
{
CHECK_STREAM_WRITE_PRECOND(*this)
Writes a signed 32-bit integer, \a i, to the stream and returns a
reference to the stream.
*/
-
QDataStream &QDataStream::operator<<(qint32 i)
{
CHECK_STREAM_WRITE_PRECOND(*this)
Writes a signed 64-bit integer, \a i, to the stream and returns a
reference to the stream.
*/
-
QDataStream &QDataStream::operator<<(qint64 i)
{
CHECK_STREAM_WRITE_PRECOND(*this)
Writes a boolean value, \a i, to the stream. Returns a reference
to the stream.
*/
-
QDataStream &QDataStream::operator<<(bool i)
{
CHECK_STREAM_WRITE_PRECOND(*this)
\sa setFloatingPointPrecision()
*/
-
QDataStream &QDataStream::operator<<(float f)
{
if (floatingPointPrecision() == QDataStream::DoublePrecision) {
return *this;
}
-
/*!
\overload
\sa setFloatingPointPrecision()
*/
-
QDataStream &QDataStream::operator<<(double f)
{
if (floatingPointPrecision() == QDataStream::SinglePrecision) {
\sa QIODevice::write(), readRawData()
*/
-
int QDataStream::writeRawData(const char *s, int len)
{
CHECK_STREAM_WRITE_PRECOND(-1)
QDataStream &operator>>(quint32 &i);
QDataStream &operator>>(qint64 &i);
QDataStream &operator>>(quint64 &i);
-
QDataStream &operator>>(bool &i);
QDataStream &operator>>(float &f);
QDataStream &operator>>(double &f);
****************************************************************************/
#include "qdebug.h"
+#include "qiodevice.h"
+#include "qbuffer.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDebugPrivate
+{
+public:
+ QDebugPrivate(QIODevice *device);
+ QDebugPrivate(QtMsgType t);
+
+ QAtomicInt ref;
+ QIODevice *dev;
+ QByteArray buffer;
+ QtMsgType type;
+ bool space;
+};
+
+QDebugPrivate::QDebugPrivate(QIODevice *device)
+ : ref(1),
+ dev(device),
+ type(QtDebugMsg),
+ space(true)
+{
+}
+
+QDebugPrivate::QDebugPrivate(QtMsgType t)
+ : ref(1),
+ dev(nullptr),
+ type(t),
+ space(true)
+{
+}
-// This file is needed to force compilation of QDebug into the kernel library.
/*!
\class QDebug
*/
/*!
- \fn QDebug::QDebug(QIODevice *device)
-
Constructs a debug stream that writes to the given \a device.
*/
+QDebug::QDebug(QIODevice *device)
+ : d_ptr(new QDebugPrivate(device))
+{
+}
/*!
- \fn QDebug::QDebug(QString *string)
-
- Constructs a debug stream that writes to the given \a string.
-*/
-
-/*!
- \fn QDebug::QDebug(QtMsgType type)
-
Constructs a debug stream that writes to the handler for the message type specified by \a type.
*/
+QDebug::QDebug(QtMsgType type)
+ : d_ptr(new QDebugPrivate(type))
+{
+}
/*!
- \fn QDebug::QDebug(const QDebug &other)
-
Constructs a copy of the \a other debug stream.
*/
+QDebug::QDebug(const QDebug &other)
+ : d_ptr(other.d_ptr)
+{
+ d_ptr->ref.ref();
+}
/*!
- \fn QDebug &QDebug::operator=(const QDebug &other)
-
Assigns the \a other debug stream to this stream and returns a reference to
this stream.
*/
+QDebug &QDebug::operator=(const QDebug &other)
+{
+ if (d_ptr != other.d_ptr) {
+ QDebug copy(other);
+ qSwap(d_ptr, copy.d_ptr);
+ }
+ return *this;
+}
/*!
- \fn QDebug::~QDebug()
-
Flushes any pending data to be written and destroys the debug stream.
*/
+QDebug::~QDebug()
+{
+ if (!d_ptr->ref.deref()) {
+ if (!d_ptr->dev) {
+ qt_message_output(d_ptr->type, d_ptr->buffer.constData());
+ } else {
+ d_ptr->dev->write(d_ptr->buffer.constData(), d_ptr->buffer.size());
+ }
+ delete d_ptr;
+ }
+}
/*!
- \fn QDebug &QDebug::space()
-
Writes a space character to the debug stream and returns a reference to
the stream.
\sa nospace(), maybeSpace()
*/
+QDebug &QDebug::space()
+{
+ d_ptr->space = true;
+ d_ptr->buffer.append(" ", 1);
+ return *this;
+}
/*!
- \fn QDebug &QDebug::nospace()
-
Clears the stream's internal flag that records whether the last character
was a space and returns a reference to the stream.
\sa space(), maybeSpace()
*/
+QDebug &QDebug::nospace()
+{
+ d_ptr->space = false;
+ return *this;
+}
/*!
- \fn QDebug &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.
\sa space(), nospace()
*/
+QDebug &QDebug::maybeSpace()
+{
+ if (d_ptr->space) {
+ d_ptr->buffer.append(" ", 1);
+ }
+ return *this;
+}
/*!
- \fn QDebug &QDebug::operator<<(QChar t)
-
Writes the character, \a t, to the stream and returns a reference to the
stream.
*/
+QDebug &QDebug::operator<<(QChar t)
+{
+ const char tc = t.toLatin1();
+ d_ptr->buffer.append("\'", 1);
+ d_ptr->buffer.append(&tc, 1);
+ d_ptr->buffer.append("\'", 1);
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(bool t)
-
Writes the boolean value, \a t, to the stream and returns a reference to the
stream.
*/
+QDebug &QDebug::operator<<(bool t)
+{
+ if (t) {
+ d_ptr->buffer.append("true", 4);
+ } else {
+ d_ptr->buffer.append("false", 5);
+ }
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(char t)
-
Writes the character, \a t, to the stream and returns a reference to the
stream.
*/
+QDebug &QDebug::operator<<(char t)
+{
+ d_ptr->buffer.append(&t, 1);
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(signed short i)
-
- Writes the signed short integer, \a i, to the stream and returns a reference
+ Writes the signed short integer, \a t, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(qint8 t)
+{
+ return QDebug::operator<<(qint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(unsigned short i)
-
- Writes then unsigned short integer, \a i, to the stream and returns a
+ Writes then unsigned short integer, \a t, to the stream and returns a
reference to the stream.
*/
+QDebug &QDebug::operator<<(quint8 t)
+{
+ return QDebug::operator<<(quint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(signed int i)
-
- Writes the signed integer, \a i, to the stream and returns a reference
+ Writes the signed integer, \a t, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(qint16 t)
+{
+ return QDebug::operator<<(qint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(unsigned int i)
-
- Writes then unsigned integer, \a i, to the stream and returns a reference to
+ Writes then unsigned integer, \a t, to the stream and returns a reference to
the stream.
*/
+QDebug &QDebug::operator<<(quint16 t)
+{
+ return QDebug::operator<<(quint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(signed long l)
-
- Writes the signed long integer, \a l, to the stream and returns a reference
+ Writes the signed integer, \a t, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(qint32 t)
+{
+ return QDebug::operator<<(qint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(unsigned long l)
+ Writes then unsigned integer, \a t, to the stream and returns a reference to
+ the stream.
+*/
+QDebug &QDebug::operator<<(quint32 t)
+{
+ return QDebug::operator<<(quint64(t));
+}
- Writes then unsigned long integer, \a l, to the stream and returns a reference
+/*!
+ Writes the signed long integer, \a t, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(long int t)
+{
+ return QDebug::operator<<(qint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(qint64 i)
-
- Writes the signed 64-bit integer, \a i, to the stream and returns a reference
+ Writes then unsigned long integer, \a t, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(unsigned long int t)
+{
+ return QDebug::operator<<(quint64(t));
+}
/*!
- \fn QDebug &QDebug::operator<<(quint64 i)
+ Writes the signed 64-bit integer, \a t, to the stream and returns a reference
+ to the stream.
+*/
+QDebug &QDebug::operator<<(qint64 t)
+{
+ d_ptr->buffer.append(QByteArray::number(t));
+ return maybeSpace();
+}
- Writes then unsigned 64-bit integer, \a i, to the stream and returns a
+/*!
+ Writes then unsigned 64-bit integer, \a t, to the stream and returns a
reference to the stream.
*/
+QDebug &QDebug::operator<<(quint64 t)
+{
+ d_ptr->buffer.append(QByteArray::number(t));
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(float f)
-
- Writes the 32-bit floating point number, \a f, to the stream and returns a
+ Writes the 32-bit floating point number, \a t, to the stream and returns a
reference to the stream.
*/
+QDebug &QDebug::operator<<(float t)
+{
+ d_ptr->buffer.append(QByteArray::number(t));
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(double f)
-
- Writes the 64-bit floating point number, \a f, to the stream and returns a
+ Writes the 64-bit floating point number, \a t, to the stream and returns a
reference to the stream.
*/
+QDebug &QDebug::operator<<(double t)
+{
+ d_ptr->buffer.append(QByteArray::number(t));
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(const char *s)
-
- Writes the '\0'-terminated string, \a s, to the stream and returns a
+ Writes the '\0'-terminated string, \a t, to the stream and returns a
reference to the stream.
*/
+QDebug &QDebug::operator<<(const char* t)
+{
+ d_ptr->buffer.append(t);
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(const QString &s)
-
- Writes the string, \a s, to the stream and returns a reference to the stream.
+ Writes the string, \a t, to the stream and returns a reference to the stream.
*/
+QDebug &QDebug::operator<<(const QString &t)
+{
+ return QDebug::operator<<(t.toLocal8Bit());
+}
/*!
- \fn QDebug &QDebug::operator<<(const QStringRef &s)
-
- Writes the string reference, \a s, to the stream and returns a reference to
+ Writes the string reference, \a t, to the stream and returns a reference to
the stream.
*/
+QDebug &QDebug::operator<<(const QStringRef &t)
+{
+ return QDebug::operator<<(t.toString());
+}
/*!
- \fn QDebug &QDebug::operator<<(const QLatin1String &s)
-
Writes the Latin1-encoded string, \a s, to the stream and returns a reference
to the stream.
*/
+QDebug &QDebug::operator<<(const QLatin1String &t)
+{
+ return QDebug::operator<<(t.latin1());
+}
/*!
- \fn QDebug &QDebug::operator<<(const QByteArray &b)
-
- Writes the byte array, \a b, to the stream and returns a reference to the
+ Writes the byte array, \a t, to the stream and returns a reference to the
stream.
*/
+QDebug &QDebug::operator<<(const QByteArray &t)
+{
+ d_ptr->buffer.append('\"');
+ d_ptr->buffer.append(t.constData(), t.size());
+ d_ptr->buffer.append('\"');
+ return maybeSpace();
+}
/*!
- \fn QDebug &QDebug::operator<<(const void *p)
-
- Writes a pointer, \a p, to the stream and returns a reference to the stream.
-*/
-
-/*!
- \fn QDebug &QDebug::operator<<(QTextStreamFunction f)
- \internal
+ Writes a pointer, \a t, to the stream and returns a reference to the stream.
*/
+QDebug &QDebug::operator<<(const void* t)
+{
+ d_ptr->buffer.append(QByteArray::number(qulonglong(quintptr(t))));
+ return maybeSpace();
+}
-/*!
- \fn QDebug &QDebug::operator<<(QTextStreamManipulator m)
- \internal
-*/
+QT_END_NAMESPACE
#ifndef QDEBUG_H
#define QDEBUG_H
-#include <QtCore/qtextstream.h>
#include <QtCore/qvector.h>
#include <QtCore/qset.h>
QT_BEGIN_NAMESPACE
+class QDebugPrivate;
+
class Q_CORE_EXPORT QDebug
{
- struct Stream {
- Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
- Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
- Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), space(true), message_output(true) {}
- QTextStream ts;
- QString buffer;
- int ref;
- QtMsgType type;
- bool space;
- bool message_output;
- } *stream;
public:
- inline QDebug(QIODevice *device) : stream(new Stream(device)) {}
- inline QDebug(QString *string) : stream(new Stream(string)) {}
- inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
- inline QDebug(const QDebug &o) : stream(o.stream) { ++stream->ref; }
- inline QDebug &operator=(const QDebug &other);
- inline ~QDebug() {
- if (!--stream->ref) {
- if(stream->message_output) {
- QByteArray data = stream->buffer.toLocal8Bit();
- qt_message_output(stream->type, data.constData());
- }
- delete stream;
- }
- }
- inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
- inline QDebug &nospace() { stream->space = false; return *this; }
- inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
-
- inline QDebug &operator<<(QChar t) { stream->ts << '\'' << t << '\''; return maybeSpace(); }
- inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
- inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(qint64 t)
- { stream->ts << QString::number(t); return maybeSpace(); }
- inline QDebug &operator<<(quint64 t)
- { stream->ts << QString::number(t); return maybeSpace(); }
- inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
- inline QDebug &operator<<(const QString & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
- inline QDebug &operator<<(const QStringRef & t) { stream->ts << '\"' << t.toString() << '\"'; return maybeSpace(); }
- inline QDebug &operator<<(const QLatin1String &t) { stream->ts << '\"' << t.latin1() << '\"'; return maybeSpace(); }
- inline QDebug &operator<<(const QByteArray & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
- inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
- inline QDebug &operator<<(QTextStreamFunction f) {
- stream->ts << f;
- return *this;
- }
-
- inline QDebug &operator<<(QTextStreamManipulator m)
- { stream->ts << m; return *this; }
+ QDebug(QIODevice *device);
+ QDebug(QtMsgType type);
+ QDebug(const QDebug &o);
+ QDebug &operator=(const QDebug &other);
+ ~QDebug();
+
+ QDebug &space();
+ QDebug &nospace();
+ QDebug &maybeSpace();
+
+ QDebug &operator<<(QChar t);
+ QDebug &operator<<(bool t);
+ QDebug &operator<<(char t);
+ QDebug &operator<<(qint8 t);
+ QDebug &operator<<(quint8 t);
+ QDebug &operator<<(qint16 t);
+ QDebug &operator<<(quint16 t);
+ QDebug &operator<<(qint32 t);
+ QDebug &operator<<(quint32 t);
+ QDebug &operator<<(qint64 t);
+ QDebug &operator<<(quint64 t);
+ QDebug &operator<<(long int t);
+ QDebug &operator<<(unsigned long int t);
+ QDebug &operator<<(float t);
+ QDebug &operator<<(double t);
+ QDebug &operator<<(const char* t);
+ QDebug &operator<<(const QString &t);
+ QDebug &operator<<(const QStringRef &t);
+ QDebug &operator<<(const QLatin1String &t);
+ QDebug &operator<<(const QByteArray &t);
+ QDebug &operator<<(const void* t);
+
+private:
+ QDebugPrivate *d_ptr;
};
-inline QDebug &QDebug::operator=(const QDebug &other)
-{
- if (this != &other) {
- QDebug copy(other);
- qSwap(stream, copy.stream);
- }
- return *this;
-}
-
template <class T>
inline QDebug operator<<(QDebug debug, const QList<T> &list)
{
#define QBITARRAY_H
#include <QtCore/qbytearray.h>
-
+#include <QtCore/qdatastream.h>
QT_BEGIN_NAMESPACE
#include <QtCore/qnamespace.h>
#include <QtCore/qsharedpointer.h>
+#include <QtCore/qdatastream.h>
QT_BEGIN_NAMESPACE
#include "qimage.h"
#include "qimage_p.h"
+#include "qvariant.h"
#include "qdebug.h"
#include "qcorecommon_p.h"
if (buttons && button != buttons)
dbg << ", buttons=" << mouseButtonsToString(buttons).constData();
if (const int mods = int(me->modifiers()))
- dbg << ", modifiers=0x" << hex << mods << dec;
+ dbg << ", modifiers=0x" << QByteArray::number(mods, 16);
dbg << ')';
break;
}
case QEvent::ShortcutOverride: {
const QKeyEvent *ke = static_cast<const QKeyEvent *>(e);
dbg << "QKeyEvent(" << eventTypeName(type)
- << ", key=0x" << hex << ke->key() << dec;
+ << ", key=0x" << QByteArray::number(ke->key(), 16);
if (const int mods = ke->modifiers())
- dbg << ", modifiers=0x" << hex << mods << dec;
+ dbg << ", modifiers=0x" << QByteArray::number(mods, 16);
if (!ke->text().isEmpty())
dbg << ", text=" << ke->text();
if (ke->isAutoRepeat())
#include <QtCore/qdebug.h>
#include <QtCore/qdatastream.h>
-
QT_BEGIN_NAMESPACE
typedef QGenericMatrix<4, 3> QMatrix4x3;
#ifndef QT_NO_DEBUG_STREAM
-
template <int N, int M>
QDebug operator<<(QDebug dbg, const QGenericMatrix<N, M> &m)
{
dbg.nospace() << "QGenericMatrix<" << N << ", " << M
- << ">(" << endl << qSetFieldWidth(10);
+ << ">(\n";
for (int row = 0; row < M; ++row) {
+ for (int spc = 0; spc < 10; ++spc)
+ dbg.space();
for (int col = 0; col < N; ++col)
dbg << m(row, col);
- dbg << endl;
+ dbg.nospace() << "\n";
}
- dbg << qSetFieldWidth(0) << ')';
+ dbg.nospace() << ')';
return dbg.space();
}
-
#endif
#ifndef QT_NO_DATASTREAM
-
template <int N, int M>
QDataStream &operator<<(QDataStream &stream, const QGenericMatrix<N, M> &matrix)
{
}
return stream;
}
-
#endif
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QMatrix4x2)
Q_DECLARE_METATYPE(QMatrix4x3)
-
#endif
#include "qmatrix.h"
#include "qtransform.h"
#include "qguicommon_p.h"
+#include "qcorecommon_p.h"
QT_BEGIN_NAMESPACE
}
#ifndef QT_NO_DEBUG_STREAM
-
QDebug operator<<(QDebug dbg, const QMatrix4x4 &m)
{
// Create a string that represents the matrix type.
bits = bits.left(bits.size() - 1);
// Output in row-major order because it is more human-readable.
- dbg.nospace() << "QMatrix4x4(type:" << bits.constData() << endl
- << qSetFieldWidth(10)
- << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) << endl
- << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) << endl
- << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) << endl
- << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << endl
- << qSetFieldWidth(0) << ')';
+ QSTACKARRAY(char, snprintfbuff, 1024);
+ snprintf(
+ snprintfbuff, sizeof(snprintfbuff),
+ "QMatrix4x4(type: %s\n"
+ " %f %f %f %f\n"
+ " %f %f %f %f\n"
+ " %f %f %f %f\n"
+ " %f %f %f %f\n"
+ ")",
+ bits.constData(),
+ m(0, 0), m(0, 1), m(0, 2), m(0, 3),
+ m(1, 0), m(1, 1), m(1, 2), m(1, 3),
+ m(2, 0), m(2, 1), m(2, 2), m(2, 3),
+ m(3, 0), m(3, 1), m(3, 2), m(3, 3)
+ );
+ dbg.nospace() << snprintfbuff;
return dbg.space();
}
{
QRectF rf = path.controlPointRect();
s << "QVectorPath(size:" << path.elementCount()
- << " hints:" << hex << path.hints()
+ << " hints:" << QByteArray::number(path.hints(), 16)
<< rf << ')';
return s;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug s, const QPainterPath &p)
{
- s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl;
+ s.nospace() << "QPainterPath: Element count=" << p.elementCount() << '\n';
static const char *types[] = {
"MoveTo",
"LineTo",
"CurveToData"
};
for (int i=0; i<p.elementCount(); ++i) {
- s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl;
+ s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ")\n";
}
return s;
#include "qfontmetrics.h"
#include "qbrush.h"
#include "qimagereader.h"
+#include "qtextstream.h"
#ifndef QT_NO_CSSPARSER
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
- -DQT_NO_DATASTREAM
-DQT_NO_LIBRARY
-DQT_NO_QOBJECT
+ -DQT_NO_DATASTREAM
-DQT_NO_TEXTSTREAM
-DQT_NO_THREAD
-DQT_NO_PROCESS
${CMAKE_SOURCE_DIR}/src/core/global/qglobal.cpp
${CMAKE_SOURCE_DIR}/src/core/global/qt_error_string.cpp
${CMAKE_SOURCE_DIR}/src/core/io/qbuffer.cpp
+ ${CMAKE_SOURCE_DIR}/src/core/io/qdebug.cpp
${CMAKE_SOURCE_DIR}/src/core/io/qdir.cpp
${CMAKE_SOURCE_DIR}/src/core/io/qdiriterator.cpp
${CMAKE_SOURCE_DIR}/src/core/io/qfile.cpp
#include "generator.h"
#include "utils.h"
-#include <QtCore/qmetatype.h>
-#include <stdio.h>
-
+#include "qvariant.h"
+#include "qmetatype.h"
#include "qmetaobject_p.h" //for the flags.
+#include <stdio.h>
+
QT_BEGIN_NAMESPACE
static uint qvariant_nameToType(const char* name)
#include <QFile>
#include <QFileInfo>
#include <QProcess>
+#include <QTextStream>
#include <sys/types.h>
#include <unistd.h>
#include <qdir.h>
#include <qfileinfo.h>
#include <qplatformdefs.h>
+#include <qtextstream.h>
#include <qdebug.h>
#include <qfileinfo_p.h>
#include "../../shared/filesystem.h"
foreach (const QNetworkAddressEntry &e, i.addressEntries()) {
QDebug s = qDebug();
s.nospace() << " address "
- << qSetFieldWidth(2) << count++ << qSetFieldWidth(0);
+ << " " << count++;
s.nospace() << ": " << qPrintable(e.ip().toString());
if (!e.netmask().isNull())
s.nospace() << '/' << e.prefixLength()
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
#include <QtCore/QMetaType>
+#include <QtCore/QTextStream>
+
#include <stdlib.h>
#ifdef QT_NO_PROCESS