debug operator improved

This commit is contained in:
Uwe Rathmann 2019-07-02 18:17:57 +02:00
parent 148a258160
commit d600fe9d7b

View File

@ -80,13 +80,23 @@ void QskLayoutHint::normalize()
#include <qdebug.h>
static inline QString qskHintValueString( qreal value )
{
if ( value >= QskLayoutConstraint::unlimited )
return QStringLiteral( "unlimited" );
else
return QString::number( value );
}
QDebug operator<<( QDebug debug, const QskLayoutHint& hint )
{
QDebugStateSaver saver( debug );
debug.nospace();
debug << "LayoutHint" << "( " << hint.minimum() << ", "
<< hint.preferred() << ", " << hint.maximum() << " )";
debug << "LayoutHint" << "( "
<< qskHintValueString( hint.minimum() ) << ", "
<< qskHintValueString( hint.preferred() ) << ", "
<< qskHintValueString( hint.maximum() ) << " )";
return debug;
}