# HG changeset patch # User Chris Cannam # Date 1702309264 0 # Mon Dec 11 15:41:04 2023 +0000 # Node ID 9c424243e78aec5a1b930e2fd8ae293ed84a62e3 # Parent 5de8a6cd1de559a6a69e7e14babfadf57bf82ca6 Crudely fix Qt6 compatibility in debug build diff --git a/src/Debug.h b/src/Debug.h --- a/src/Debug.h +++ b/src/Debug.h @@ -53,6 +53,17 @@ return d; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +template <> +inline QDebug &operator<<(QDebug &d, const QVariant &t) { + QString s; + QTextStream ts(&s); + ts << t.toString(); + d << s; + return d; +} +#endif + } #else @@ -75,13 +86,13 @@ #define DQ_DEBUG ::Dataquay::NoDebug() +#endif /* !NDEBUG */ + #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using Qt::endl; #elif QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) using QTextStreamFunctions::endl; #endif -#endif /* !NDEBUG */ - #endif /* !_DEBUG_H_ */