using elementCount instead of count

This commit is contained in:
Uwe Rathmann 2020-11-11 10:31:39 +01:00
parent b53eaaaa95
commit da1f385682
10 changed files with 18 additions and 18 deletions

View File

@ -111,7 +111,7 @@ Box::Box( QQuickItem* parent )
void Box::flip()
{
for ( int i = 0; i < count(); i++ )
for ( int i = 0; i < elementCount(); i++ )
{
if ( auto control = dynamic_cast< Control* >( itemAtIndex( i ) ) )
control->transpose();

View File

@ -78,7 +78,7 @@ namespace
void addRectangle( const char* colorName )
{
auto rect = new TestRectangle( colorName );
rect->setText( QString::number( count() + 1 ) );
rect->setText( QString::number( elementCount() + 1 ) );
addItem( rect );
}

View File

@ -71,7 +71,7 @@ namespace
void addRectangle( const char* colorName )
{
auto rect = new TestRectangle( colorName );
rect->setText( QString::number( count() + 1 ) );
rect->setText( QString::number( elementCount() + 1 ) );
addItem( rect );
}

View File

@ -128,7 +128,7 @@ class IconGrid : public QskLinearBox
setSize( sizeConstraint() );
updateLayout(); // so that every item has its initial geometry
for ( int i = 0; i < count(); i++ )
for ( int i = 0; i < elementCount(); i++ )
{
if ( auto item = qobject_cast< QskControl* > ( itemAtIndex( i ) ) )
{

View File

@ -87,7 +87,7 @@ void Window::centerButtons()
QVector< QskDialogButtonBox* > Window::dialogBoxes() const
{
QVector< QskDialogButtonBox* > boxes;
for ( int i = 0; i < m_layoutBox->count(); i++ )
for ( int i = 0; i < m_layoutBox->elementCount(); i++ )
{
if ( auto box = qobject_cast< QskDialogButtonBox* >( m_layoutBox->itemAtIndex( i ) ) )
{

View File

@ -53,7 +53,7 @@ namespace
QskControl::keyPressEvent.
*/
for ( int i = 0; i < count(); i++ )
for ( int i = 0; i < elementCount(); i++ )
{
if ( auto button = itemAtIndex( i ) )
button->setZ( i == currentIndex ? 0.001 : 0.0 );
@ -425,8 +425,8 @@ int QskTabBar::insertTab( int index, QskTabButton* button )
{
auto buttonBox = m_data->buttonBox;
if ( index < 0 || index >= buttonBox->count() )
index = buttonBox->count();
if ( index < 0 || index >= buttonBox->elementCount() )
index = buttonBox->elementCount();
if ( isComponentComplete() )
{
@ -569,7 +569,7 @@ int QskTabBar::currentIndex() const
int QskTabBar::count() const
{
return m_data->buttonBox->count();
return m_data->buttonBox->elementCount();
}
QskTabButton* QskTabBar::buttonAt( int position )

View File

@ -224,7 +224,7 @@ void QskGridBox::clear( bool autoDelete )
{
m_data->blockAutoRemove = true;
for ( int i = 0; i < count(); i++ )
for ( int i = 0; i < elementCount(); i++ )
{
if ( auto item = itemAtIndex( i ) )
{
@ -242,7 +242,7 @@ void QskGridBox::clear( bool autoDelete )
m_data->engine.clear();
}
int QskGridBox::count() const
int QskGridBox::elementCount() const
{
return m_data->engine.count();
}

View File

@ -16,7 +16,7 @@ class QSK_EXPORT QskGridBox : public QskBox
WRITE setDefaultAlignment NOTIFY defaultAlignmentChanged )
Q_PROPERTY( bool empty READ isEmpty() )
Q_PROPERTY( int count READ count )
Q_PROPERTY( int elementCount READ elementCount )
using Inherited = QskBox;
@ -46,7 +46,7 @@ class QSK_EXPORT QskGridBox : public QskBox
Q_INVOKABLE int rowCount() const;
Q_INVOKABLE int columnCount() const;
int count() const;
int elementCount() const;
QQuickItem* itemAtIndex( int index ) const;
int indexOf( const QQuickItem* ) const;
@ -118,7 +118,7 @@ inline int QskGridBox::addItem( QQuickItem* item, int row, int column )
inline bool QskGridBox::isEmpty() const
{
return count() <= 0;
return elementCount() <= 0;
}
inline void QskGridBox::setSpacing( qreal spacing )

View File

@ -75,7 +75,7 @@ QskLinearBox::~QskLinearBox()
}
}
int QskLinearBox::count() const
int QskLinearBox::elementCount() const
{
return m_data->engine.count();
}

View File

@ -27,7 +27,7 @@ class QSK_EXPORT QskLinearBox : public QskIndexedLayoutBox
Q_PROPERTY( Qt::Edges extraSpacingAt READ extraSpacingAt
WRITE setExtraSpacingAt NOTIFY extraSpacingAtChanged )
Q_PROPERTY( int count READ count )
Q_PROPERTY( int elementCount READ elementCount )
Q_PROPERTY( bool empty READ isEmpty() )
using Inherited = QskIndexedLayoutBox;
@ -40,7 +40,7 @@ class QSK_EXPORT QskLinearBox : public QskIndexedLayoutBox
~QskLinearBox() override;
bool isEmpty() const;
int count() const; // items and spacers
int elementCount() const; // items and spacers
qreal spacingAtIndex( int index ) const;
@ -121,7 +121,7 @@ class QSK_EXPORT QskLinearBox : public QskIndexedLayoutBox
inline bool QskLinearBox::isEmpty() const
{
return count() <= 0;
return elementCount() <= 0;
}
#endif