diff options
author | Volker Hilsheimer <[email protected]> | 2025-01-09 11:02:37 +0100 |
---|---|---|
committer | Volker Hilsheimer <[email protected]> | 2025-01-13 16:38:43 +0100 |
commit | b562c36a9a7be5f62a8e79b93c9728381775f460 (patch) | |
tree | 9aad8267b7864c7b63581bb3f13d992c34b8fa21 | |
parent | 21bd32b2cc8995d8624cd0fea6f6685827c741c1 (diff) |
QFontVariableAxis: add debug stream support
Was missing from this new value type, and is quite useful for this type.
Addresses API review comment.
Pick-to: 6.9
Change-Id: I07ea7ded7f963b2032c377f024bb88e9d54a4d5c
Reviewed-by: Ivan Solovev <[email protected]>
Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r-- | src/gui/text/qfontvariableaxis.cpp | 22 | ||||
-rw-r--r-- | src/gui/text/qfontvariableaxis.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/text/qfontvariableaxis.cpp b/src/gui/text/qfontvariableaxis.cpp index dfce507afe3..1c253560b29 100644 --- a/src/gui/text/qfontvariableaxis.cpp +++ b/src/gui/text/qfontvariableaxis.cpp @@ -3,6 +3,8 @@ #include "qfontvariableaxis.h" +#include <QtCore/qdebug.h> + QT_BEGIN_NAMESPACE class QFontVariableAxisPrivate : public QSharedData @@ -223,4 +225,24 @@ void QFontVariableAxis::detach() d_ptr.detach(); } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug debug, const QFontVariableAxis &axis) +{ + QDebugStateSaver save(debug); + + debug.nospace().noquote(); + const QString name = axis.name(); + if (!name.isEmpty()) + debug << name << '('; + + debug << axis.tag(); + if (!name.isEmpty()) + debug << ')'; + debug << '[' << axis.minimumValue() << "..." << axis.maximumValue() + << "; default=" << axis.defaultValue() << ']'; + + return debug; +} +#endif + QT_END_NAMESPACE diff --git a/src/gui/text/qfontvariableaxis.h b/src/gui/text/qfontvariableaxis.h index 930acf7136c..0eb56ae6569 100644 --- a/src/gui/text/qfontvariableaxis.h +++ b/src/gui/text/qfontvariableaxis.h @@ -56,6 +56,10 @@ private: QByteArray tagString() const { return tag().toString(); } void detach(); +#ifndef QT_NO_DEBUG_STREAM + Q_GUI_EXPORT friend QDebug operator<<(QDebug debug, const QFontVariableAxis &axis); +#endif + QExplicitlySharedDataPointer<QFontVariableAxisPrivate> d_ptr; }; |