QskHintAnimatorTable::isEmpty added

This commit is contained in:
Uwe Rathmann 2022-09-06 07:57:08 +02:00
parent 0b38a95677
commit b926476e55
2 changed files with 10 additions and 4 deletions

View File

@ -204,13 +204,11 @@ namespace
class QskHintAnimatorTable::PrivateData
{
public:
// we won't have many entries, so we prefer less memory over
// using a hash table
// we could use a std::set< QskHintAnimator > instead
std::map< QskAspect, QskHintAnimator > map;
};
QskHintAnimatorTable::QskHintAnimatorTable()
: m_data( nullptr )
{
}
@ -218,6 +216,7 @@ QskHintAnimatorTable::~QskHintAnimatorTable()
{
if ( qskAnimatorGuard )
qskAnimatorGuard->unregisterTable( this );
delete m_data;
}
@ -228,6 +227,7 @@ void QskHintAnimatorTable::start( QskControl* control,
if ( m_data == nullptr )
{
m_data = new PrivateData();
if ( qskAnimatorGuard )
qskAnimatorGuard->registerTable( this );
}

View File

@ -54,12 +54,13 @@ class QSK_EXPORT QskHintAnimatorTable
QVariant currentValue( QskAspect ) const;
bool cleanup();
bool isEmpty() const;
private:
void reset();
class PrivateData;
PrivateData* m_data;
PrivateData* m_data = nullptr;
};
inline QskAspect QskHintAnimator::aspect() const noexcept
@ -82,4 +83,9 @@ inline bool QskHintAnimator::operator<( const QskHintAnimator& other ) const noe
return m_aspect < other.m_aspect;
}
inline bool QskHintAnimatorTable::isEmpty() const
{
return m_data == nullptr;
}
#endif