summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-12-22 13:46:15 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-05 15:02:56 +0100
commit9498f1aa54fefb3d1c78f5e38880607147512567 (patch)
tree519ce3c75c674de937d1139b55877e7923b1fb3d /src/corelib/io/qdebug.h
parentec104d7a5480b334cbbdc41d1536670585da6bba (diff)
Fix compile error with qWarning() << myDateTime and QT_NO_DEBUG_OUTPUT
All QDebug operator << in custom classes were disabled by QT_NO_DEBUG_STREAM, which was set by QT_NO_DEBUG_OUTPUT. Now QT_NO_DEBUG_STREAM is never set automatically, but remains available for reducing the feature set altogether (qconfig.h). Remove check on QT_NO_TEXTSTREAM: this define is meaningless, it doesn't even undefine QTextStream, and this is unrelated to QDebug streaming anyway. Change-Id: I5eeed0144fa684d0e790e9dfd9a4aeb956218c39 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r--src/corelib/io/qdebug.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index d5fe36e0c8..ecef792e70 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -141,8 +141,6 @@ public:
inline QNoDebug &operator<<(const T &) { return *this; }
};
-Q_CORE_EXPORT_INLINE QDebug qCritical() { return QDebug(QtCriticalMsg); }
-
inline QDebug &QDebug::operator=(const QDebug &other)
{
if (this != &other) {
@@ -275,17 +273,15 @@ inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
return debug.space();
}
-#if !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_OUTPUT) && !defined(QT_NO_DEBUG_STREAM)
Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }
-
-#else // QT_NO_DEBUG_STREAM
+#else
#undef qDebug
inline QNoDebug qDebug() { return QNoDebug(); }
#define qDebug QT_NO_QDEBUG_MACRO
-
#endif
-#if !defined(QT_NO_WARNING_OUTPUT)
+#if !defined(QT_NO_WARNING_OUTPUT) && !defined(QT_NO_DEBUG_STREAM)
Q_CORE_EXPORT_INLINE QDebug qWarning() { return QDebug(QtWarningMsg); }
#else
#undef qWarning
@@ -293,6 +289,11 @@ inline QNoDebug qWarning() { return QNoDebug(); }
#define qWarning QT_NO_QWARNING_MACRO
#endif
+#if !defined(QT_NO_DEBUG_STREAM)
+Q_CORE_EXPORT_INLINE QDebug qCritical() { return QDebug(QtCriticalMsg); }
+#endif
+
+
QT_END_NAMESPACE
QT_END_HEADER