From 633349982422fec92df4ed06da5d2becf788c494 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 15 Jul 2010 10:39:40 +0200 Subject: Amend previous commit 4e2eb2945dbc3865e2901f12d663ed89e8f0dfbf to fix compilation with QT_NO_DEBUG_STREAM Qt in debug need to stay binary compatible with Qt in release. See also commit cbbd7e084c7e46fd906db26b13032b8368c59093 that introduced the problem Task-number: QTBUG-11510 --- src/gui/styles/qstyle.cpp | 4 +++- src/gui/styles/qstyle.h | 2 +- src/gui/styles/qstyleoption.cpp | 6 +++++- src/gui/styles/qstyleoption.h | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 676483e..687e587 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -2421,9 +2421,10 @@ QT_BEGIN_INCLUDE_NAMESPACE #include QT_END_INCLUDE_NAMESPACE -#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) QDebug operator<<(QDebug debug, QStyle::State state) { +#if !defined(QT_NO_DEBUG) debug << "QStyle::State("; QStringList states; @@ -2455,6 +2456,7 @@ QDebug operator<<(QDebug debug, QStyle::State state) qSort(states); debug << states.join(QLatin1String(" | ")); debug << ')'; +#endif return debug; } #endif diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h index 1ee262d..439901a 100644 --- a/src/gui/styles/qstyle.h +++ b/src/gui/styles/qstyle.h @@ -878,7 +878,7 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State) Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls) -#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state); #endif diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index eeab316..4780edf 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -5419,9 +5419,10 @@ QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, T Returns a T or 0 depending on the type of \a hint. */ -#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) { +#if !defined(QT_NO_DEBUG) switch (optionType) { case QStyleOption::SO_Default: debug << "SO_Default"; break; @@ -5482,17 +5483,20 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) case QStyleOption::SO_GraphicsItem: debug << "SO_GraphicsItem"; break; } +#endif return debug; } QDebug operator<<(QDebug debug, const QStyleOption &option) { +#if !defined(QT_NO_DEBUG) debug << "QStyleOption("; debug << QStyleOption::OptionType(option.type); debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight"); debug << ',' << option.state; debug << ',' << option.rect; debug << ')'; +#endif return debug; } #endif diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h index 005b36a..e79d9a4 100644 --- a/src/gui/styles/qstyleoption.h +++ b/src/gui/styles/qstyleoption.h @@ -958,7 +958,7 @@ T qstyleoption_cast(QStyleHintReturn *hint) return 0; } -#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType); Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option); #endif -- cgit v0.12