QMetaType support, debug operator
This commit is contained in:
parent
b10694dff9
commit
d54404c9f4
@ -6,13 +6,13 @@
|
|||||||
#include "QskScaleTickmarks.h"
|
#include "QskScaleTickmarks.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
int QskScaleTickmarks::tickCount() const noexcept
|
static void qskRegisterTickmarks()
|
||||||
{
|
{
|
||||||
return m_ticks[ MajorTick ].count()
|
qRegisterMetaType< QskScaleTickmarks >();
|
||||||
+ m_ticks[ MediumTick ].count()
|
|
||||||
+ m_ticks[ MinorTick ].count();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION( qskRegisterTickmarks )
|
||||||
|
|
||||||
QskScaleTickmarks::QskScaleTickmarks()
|
QskScaleTickmarks::QskScaleTickmarks()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -21,6 +21,14 @@ QskScaleTickmarks::~QskScaleTickmarks()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int QskScaleTickmarks::tickCount() const noexcept
|
||||||
|
{
|
||||||
|
return m_ticks[ MajorTick ].count()
|
||||||
|
+ m_ticks[ MediumTick ].count()
|
||||||
|
+ m_ticks[ MinorTick ].count();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int QskScaleTickmarks::tickCount( TickType type ) const noexcept
|
int QskScaleTickmarks::tickCount( TickType type ) const noexcept
|
||||||
{
|
{
|
||||||
return m_ticks[ type ].count();
|
return m_ticks[ type ].count();
|
||||||
@ -66,4 +74,18 @@ bool QskScaleTickmarks::operator==( const QskScaleTickmarks& other ) const noexc
|
|||||||
&& ( m_ticks[ 2 ] == other.m_ticks[ 2 ] );
|
&& ( m_ticks[ 2 ] == other.m_ticks[ 2 ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
QDebug operator<<( QDebug debug, const QskScaleTickmarks& tickmarks )
|
||||||
|
{
|
||||||
|
debug << tickmarks.majorTicks()
|
||||||
|
<< tickmarks.mediumTicks() << tickmarks.minorTicks();
|
||||||
|
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "moc_QskScaleTickmarks.cpp"
|
#include "moc_QskScaleTickmarks.cpp"
|
||||||
|
@ -93,4 +93,12 @@ inline bool QskScaleTickmarks::operator!=(
|
|||||||
return !( *this == other );
|
return !( *this == other );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE( QskScaleTickmarks )
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
|
QSK_EXPORT QDebug operator<<( QDebug, const QskScaleTickmarks& );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user