6#include "QskGraduationMetrics.h"
9static void qskRegisterGraduationMetrics()
11 qRegisterMetaType< QskGraduationMetrics >();
13#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
14 QMetaType::registerEqualsComparator< QskGraduationMetrics >();
18Q_CONSTRUCTOR_FUNCTION( qskRegisterGraduationMetrics )
20static inline qreal qskInterpolated( qreal from, qreal to, qreal ratio )
22 return from + ( to - from ) * ratio;
28 if ( ( *
this == to ) )
31 return { qskInterpolated( m_tickLengths[0], to.m_tickLengths[0], ratio ),
32 qskInterpolated( m_tickLengths[1], to.m_tickLengths[1], ratio ),
33 qskInterpolated( m_tickLengths[2], to.m_tickLengths[2], ratio ),
34 qskInterpolated( m_tickWidth, to.m_tickWidth, ratio ) };
37QVariant QskGraduationMetrics::interpolate(
40 return QVariant::fromValue( from.interpolated( to, progress ) );
43#ifndef QT_NO_DEBUG_STREAM
49 const char s[] =
", ";
51 QDebugStateSaver saver( debug );
54 debug <<
"Graduation";
56 debug << metrics.minorTickLength() << s << metrics.mediumTickLength()
57 << s << metrics.majorTickLength() <<
"W:" << metrics.tickWidth();