diff --git a/examples/layouts/DynamicConstraintsPage.cpp b/examples/layouts/DynamicConstraintsPage.cpp index 94b03126..63081547 100644 --- a/examples/layouts/DynamicConstraintsPage.cpp +++ b/examples/layouts/DynamicConstraintsPage.cpp @@ -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(); diff --git a/examples/layouts/FlowLayoutPage.cpp b/examples/layouts/FlowLayoutPage.cpp index b3863654..f6197379 100644 --- a/examples/layouts/FlowLayoutPage.cpp +++ b/examples/layouts/FlowLayoutPage.cpp @@ -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 ); } diff --git a/examples/layouts/LinearLayoutPage.cpp b/examples/layouts/LinearLayoutPage.cpp index e10737e6..5008a2c5 100644 --- a/examples/layouts/LinearLayoutPage.cpp +++ b/examples/layouts/LinearLayoutPage.cpp @@ -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 ); } diff --git a/examples/thumbnails/main.cpp b/examples/thumbnails/main.cpp index 9ae9da28..04f0af7e 100644 --- a/examples/thumbnails/main.cpp +++ b/examples/thumbnails/main.cpp @@ -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 ) ) ) { diff --git a/playground/dialogbuttons/Window.cpp b/playground/dialogbuttons/Window.cpp index 6cc24e00..4a1d119d 100644 --- a/playground/dialogbuttons/Window.cpp +++ b/playground/dialogbuttons/Window.cpp @@ -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 ) ) ) { diff --git a/src/controls/QskTabBar.cpp b/src/controls/QskTabBar.cpp index 8f9daeb9..cb506020 100644 --- a/src/controls/QskTabBar.cpp +++ b/src/controls/QskTabBar.cpp @@ -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 ) diff --git a/src/layouts/QskGridBox.cpp b/src/layouts/QskGridBox.cpp index 0064ad25..bff2911d 100644 --- a/src/layouts/QskGridBox.cpp +++ b/src/layouts/QskGridBox.cpp @@ -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(); } diff --git a/src/layouts/QskGridBox.h b/src/layouts/QskGridBox.h index cf81f500..73cfe27a 100644 --- a/src/layouts/QskGridBox.h +++ b/src/layouts/QskGridBox.h @@ -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 ) diff --git a/src/layouts/QskLinearBox.cpp b/src/layouts/QskLinearBox.cpp index 2b5e4409..a64dd68a 100644 --- a/src/layouts/QskLinearBox.cpp +++ b/src/layouts/QskLinearBox.cpp @@ -75,7 +75,7 @@ QskLinearBox::~QskLinearBox() } } -int QskLinearBox::count() const +int QskLinearBox::elementCount() const { return m_data->engine.count(); } diff --git a/src/layouts/QskLinearBox.h b/src/layouts/QskLinearBox.h index 4b329320..1288ff4e 100644 --- a/src/layouts/QskLinearBox.h +++ b/src/layouts/QskLinearBox.h @@ -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