convenience functions added
This commit is contained in:
parent
6838260606
commit
8555cc3cc4
@ -76,6 +76,12 @@ void QskLayoutHint::normalize()
|
|||||||
m_preferred = qBound( m_minimum, m_preferred, m_maximum );
|
m_preferred = qBound( m_minimum, m_preferred, m_maximum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskLayoutHint::isDefault() const
|
||||||
|
{
|
||||||
|
return ( m_minimum == 0.0 ) && (m_preferred == 0.0 )
|
||||||
|
&& ( m_maximum == QskLayoutConstraint::unlimited );
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
@ -20,6 +20,9 @@ class QSK_EXPORT QskLayoutHint
|
|||||||
void intersect( const QskLayoutHint& );
|
void intersect( const QskLayoutHint& );
|
||||||
void normalize();
|
void normalize();
|
||||||
|
|
||||||
|
QskLayoutHint normalized() const;
|
||||||
|
bool isDefault() const;
|
||||||
|
|
||||||
qreal size( int which ) const;
|
qreal size( int which ) const;
|
||||||
void setSize( int which, qreal size );
|
void setSize( int which, qreal size );
|
||||||
|
|
||||||
@ -83,6 +86,13 @@ inline bool QskLayoutHint::operator!=( const QskLayoutHint& other ) const
|
|||||||
return !( *this == other );
|
return !( *this == other );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QskLayoutHint QskLayoutHint::normalized() const
|
||||||
|
{
|
||||||
|
auto hint = *this;
|
||||||
|
hint.normalize();
|
||||||
|
return hint;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
QSK_EXPORT QDebug operator<<( QDebug, const QskLayoutHint& );
|
QSK_EXPORT QDebug operator<<( QDebug, const QskLayoutHint& );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user