QFontVariableAxis: add debug stream support
Was missing from this new value type, and is quite useful for this type. Addresses API review comment. Change-Id: I07ea7ded7f963b2032c377f024bb88e9d54a4d5c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit b562c36a9a7be5f62a8e79b93c9728381775f460) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b7711eb94c
commit
e09afd3cc0
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user