diff --git a/examples/barmodelmapper/tablewidget.cpp b/examples/barmodelmapper/tablewidget.cpp index 89f457b..6727710 100644 --- a/examples/barmodelmapper/tablewidget.cpp +++ b/examples/barmodelmapper/tablewidget.cpp @@ -65,8 +65,8 @@ TableWidget::TableWidget(QWidget *parent) QVBarModelMapper *mapper = new QVBarModelMapper(this); mapper->setFirstBarSetColumn(1); mapper->setLastBarSetColumn(4); - mapper->setFirst(first); - mapper->setCount(count); + mapper->setFirstRow(first); + mapper->setRowCount(count); mapper->setSeries(series); mapper->setModel(model); chart->addSeries(series); diff --git a/src/barchart/qbarmodelmapper.cpp b/src/barchart/qbarmodelmapper.cpp index 58b9039..dd4de7a 100644 --- a/src/barchart/qbarmodelmapper.cpp +++ b/src/barchart/qbarmodelmapper.cpp @@ -71,28 +71,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \property QBarModelMapper::first - \brief Defines which item of the model's row/column should be mapped as the value of the first QBarSet in the series. - Minimal and default value is: 0 -*/ -/*! - \qmlproperty int BarModelMapper::first - Defines which item of the model's row/column should be mapped as the value of the first QBarSet in the series. - The default value is 0. -*/ - -/*! - \property QBarModelMapper::count - \brief Defines the number of rows/columns of the model that are mapped as the data for QBarSeries - Minimal and default value is: -1 (count limited by the number of rows/columns in the model) -*/ -/*! - \qmlproperty int BarModelMapper::count - Defines the number of rows/columns of the model that are mapped as the data for QBarSeries. The default value is - -1 (count limited by the number of rows/columns in the model) -*/ - -/*! \fn void QBarModelMapper::seriesReplaced() Emitted when the series to which mapper is connected to has changed. */ @@ -103,16 +81,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \fn void QBarModelMapper::firstChanged() - Emitted when the value for the first has changed. -*/ - -/*! - \fn void QBarModelMapper::countChanged() - Emitted when the value for the count has changed. -*/ - -/*! Constructs a mapper object which is a child of \a parent. */ QBarModelMapper::QBarModelMapper(QObject *parent) : @@ -175,38 +143,46 @@ void QBarModelMapper::setSeries(QBarSeries *series) emit seriesReplaced(); } +/*! + Returns which row/column of the model contains the first values of the QBarSets in the series. + The default value is 0. +*/ int QBarModelMapper::first() const { Q_D(const QBarModelMapper); return d->m_first; } +/*! + Sets which row of the model contains the \a first values of the QBarSets in the series. + The default value is 0. +*/ void QBarModelMapper::setFirst(int first) { Q_D(QBarModelMapper); - if (first != d->m_first) { - d->m_first = qMax(first, 0); - d->initializeBarFromModel(); - - emit firstChanged(); - } + d->m_first = qMax(first, 0); + d->initializeBarFromModel(); } +/*! + Returns the number of rows/columns of the model that are mapped as the data for QBarSeries + Minimal and default value is: -1 (count limited by the number of rows/columns in the model) +*/ int QBarModelMapper::count() const { Q_D(const QBarModelMapper); return d->m_count; } +/*! + Sets the \a count of rows/columns of the model that are mapped as the data for QBarSeries + Minimal and default value is: -1 (count limited by the number of rows/columns in the model) +*/ void QBarModelMapper::setCount(int count) { Q_D(QBarModelMapper); - if (count != d->m_count) { - d->m_count = qMax(count, -1); - d->initializeBarFromModel(); - - emit countChanged(); - } + d->m_count = qMax(count, -1); + d->initializeBarFromModel(); } /*! diff --git a/src/barchart/qbarmodelmapper.h b/src/barchart/qbarmodelmapper.h index b94e949..5af9805 100644 --- a/src/barchart/qbarmodelmapper.h +++ b/src/barchart/qbarmodelmapper.h @@ -37,8 +37,6 @@ class QTCOMMERCIALCHART_EXPORT QBarModelMapper : public QObject Q_OBJECT Q_PROPERTY(QBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced) Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced) - Q_PROPERTY(int first READ first WRITE setFirst NOTIFY firstChanged) - Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged) Q_ENUMS(Qt::Orientation) protected: @@ -51,15 +49,15 @@ public: QBarSeries* series() const; void setSeries(QBarSeries *series); + void reset(); + +protected: int first() const; void setFirst(int first); int count() const; void setCount(int count); - void reset(); - -protected: int firstBarSetSection() const; void setFirstBarSetSection(int firstBarSetSection); @@ -72,8 +70,6 @@ protected: Q_SIGNALS: void seriesReplaced(); void modelReplaced(); - void firstChanged(); - void countChanged(); protected: QBarModelMapperPrivate * const d_ptr; diff --git a/src/barchart/qhbarmodelmapper.cpp b/src/barchart/qhbarmodelmapper.cpp index 75f6795..bc4ed0c 100644 --- a/src/barchart/qhbarmodelmapper.cpp +++ b/src/barchart/qhbarmodelmapper.cpp @@ -69,6 +69,28 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QHBarModelMapper::firstColumn + \brief Defines which column of the model contains the first values of the QBarSets in the series. + Minimal and default value is: 0 +*/ +/*! + \qmlproperty int BarModelMapper::first + Defines which column of the model contains the first values of the QBarSets in the series. + The default value is 0. +*/ + +/*! + \property QHBarModelMapper::columnCount + \brief Defines the number of rows of the model that are mapped as the data for QBarSeries + Minimal and default value is: -1 (count limited by the number of rows in the model) +*/ +/*! + \qmlproperty int BarModelMapper::count + Defines the number of rows of the model that are mapped as the data for QBarSeries. The default value is + -1 (count limited by the number of rows in the model) +*/ + +/*! \fn void QHBarModelMapper::firstBarSetRowChanged() Emitted when the firstBarSetRow has changed. @@ -81,6 +103,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QHBarModelMapper::firstColumnChanged() + Emitted when the firstColumn has changed. +*/ + +/*! + \fn void QHBarModelMapper::columnCountChanged() + Emitted when the columnCount has changed. +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QHBarModelMapper::QHBarModelMapper(QObject *parent) : @@ -97,7 +129,7 @@ int QHBarModelMapper::firstBarSetRow() const void QHBarModelMapper::setFirstBarSetRow(int firstBarSetRow) { if (firstBarSetRow != firstBarSetSection()) { - return QBarModelMapper::setFirstBarSetSection(firstBarSetRow); + QBarModelMapper::setFirstBarSetSection(firstBarSetRow); emit firstBarSetRowChanged(); } } @@ -110,11 +142,37 @@ int QHBarModelMapper::lastBarSetRow() const void QHBarModelMapper::setLastBarSetRow(int lastBarSetRow) { if (lastBarSetRow != lastBarSetSection()) { - return QBarModelMapper::setLastBarSetSection(lastBarSetRow); + QBarModelMapper::setLastBarSetSection(lastBarSetRow); emit lastBarSetRowChanged(); } } +int QHBarModelMapper::firstColumn() const +{ + return QBarModelMapper::first(); +} + +void QHBarModelMapper::setFirstColumn(int firstColumn) +{ + if (firstColumn != first()) { + QBarModelMapper::setFirst(firstColumn); + emit firstColumnChanged(); + } +} + +int QHBarModelMapper::columnCount() const +{ + return QBarModelMapper::count(); +} + +void QHBarModelMapper::setColumnCount(int columnCount) +{ + if (columnCount != count()) { + QBarModelMapper::setCount(columnCount); + emit firstColumnChanged(); + } +} + #include "moc_qhbarmodelmapper.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qhbarmodelmapper.h b/src/barchart/qhbarmodelmapper.h index b4469df..453667a 100644 --- a/src/barchart/qhbarmodelmapper.h +++ b/src/barchart/qhbarmodelmapper.h @@ -30,6 +30,8 @@ class QTCOMMERCIALCHART_EXPORT QHBarModelMapper : public QBarModelMapper Q_OBJECT Q_PROPERTY(int firstBarSetRow READ firstBarSetRow WRITE setFirstBarSetRow NOTIFY firstBarSetRowChanged) Q_PROPERTY(int lastBarSetRow READ lastBarSetRow WRITE setLastBarSetRow NOTIFY lastBarSetRowChanged) + Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged) + Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged) public: explicit QHBarModelMapper(QObject *parent = 0); @@ -40,9 +42,17 @@ public: int lastBarSetRow() const; void setLastBarSetRow(int lastBarSetRow); + int firstColumn() const; + void setFirstColumn(int firstColumn); + + int columnCount() const; + void setColumnCount(int columnCount); + Q_SIGNALS: void firstBarSetRowChanged(); void lastBarSetRowChanged(); + void firstColumnChanged(); + void columnCountChanged(); }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qvbarmodelmapper.cpp b/src/barchart/qvbarmodelmapper.cpp index 3f5cc25..8dad1cd 100644 --- a/src/barchart/qvbarmodelmapper.cpp +++ b/src/barchart/qvbarmodelmapper.cpp @@ -77,6 +77,28 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QVBarModelMapper::firstRow + \brief Defines which row of the model contains the first values of the QBarSets in the series. + Minimal and default value is: 0 +*/ +/*! + \qmlproperty int BarModelMapper::first + Defines which row of the model contains the first values of the QBarSets in the series. + The default value is 0. +*/ + +/*! + \property QVBarModelMapper::rowCount + \brief Defines the number of rows of the model that are mapped as the data for QBarSeries + Minimal and default value is: -1 (count limited by the number of rows in the model) +*/ +/*! + \qmlproperty int BarModelMapper::count + Defines the number of rows of the model that are mapped as the data for QBarSeries. The default value is + -1 (count limited by the number of rows in the model) +*/ + +/*! \fn void QVBarModelMapper::firstBarSetColumnChanged() Emitted when the firstBarSetColumn has changed. */ @@ -87,6 +109,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QVBarModelMapper::firstRowChanged() + Emitted when the firstRow has changed. +*/ + +/*! + \fn void QVBarModelMapper::rowCountChanged() + Emitted when the rowCount has changed. +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QVBarModelMapper::QVBarModelMapper(QObject *parent) : @@ -103,7 +135,7 @@ int QVBarModelMapper::firstBarSetColumn() const void QVBarModelMapper::setFirstBarSetColumn(int firstBarSetColumn) { if (firstBarSetColumn != firstBarSetSection()) { - return QBarModelMapper::setFirstBarSetSection(firstBarSetColumn); + QBarModelMapper::setFirstBarSetSection(firstBarSetColumn); emit firstBarSetColumnChanged(); } } @@ -116,11 +148,37 @@ int QVBarModelMapper::lastBarSetColumn() const void QVBarModelMapper::setLastBarSetColumn(int lastBarSetColumn) { if (lastBarSetColumn != lastBarSetSection()) { - return QBarModelMapper::setLastBarSetSection(lastBarSetColumn); + QBarModelMapper::setLastBarSetSection(lastBarSetColumn); emit lastBarSetColumnChanged(); } } +int QVBarModelMapper::firstRow() const +{ + return QBarModelMapper::first(); +} + +void QVBarModelMapper::setFirstRow(int firstRow) +{ + if (firstRow != first()) { + QBarModelMapper::setFirst(firstRow); + emit firstRowChanged(); + } +} + +int QVBarModelMapper::rowCount() const +{ + return QBarModelMapper::count(); +} + +void QVBarModelMapper::setRowCount(int rowCount) +{ + if (rowCount != count()) { + QBarModelMapper::setCount(rowCount); + emit firstRowChanged(); + } +} + #include "moc_qvbarmodelmapper.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qvbarmodelmapper.h b/src/barchart/qvbarmodelmapper.h index ae927da..04152cf 100644 --- a/src/barchart/qvbarmodelmapper.h +++ b/src/barchart/qvbarmodelmapper.h @@ -30,6 +30,8 @@ class QTCOMMERCIALCHART_EXPORT QVBarModelMapper : public QBarModelMapper Q_OBJECT Q_PROPERTY(int firstBarSetColumn READ firstBarSetColumn WRITE setFirstBarSetColumn NOTIFY firstBarSetColumnChanged) Q_PROPERTY(int lastBarSetColumn READ lastBarSetColumn WRITE setLastBarSetColumn NOTIFY lastBarSetColumnChanged) + Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged) + Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged) public: explicit QVBarModelMapper(QObject *parent = 0); @@ -40,9 +42,17 @@ public: int lastBarSetColumn() const; void setLastBarSetColumn(int lastBarSetColumn); + int firstRow() const; + void setFirstRow(int firstRow); + + int rowCount() const; + void setRowCount(int rowCount); + Q_SIGNALS: void firstBarSetColumnChanged(); void lastBarSetColumnChanged(); + void firstRowChanged(); + void rowCountChanged(); }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp b/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp index 64d1e23..2d16933 100644 --- a/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp +++ b/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp @@ -223,8 +223,8 @@ void tst_qbarmodelmapper::verticalMapperCustomMapping() mapper->setLastBarSetColumn(1); mapper->setModel(m_model); mapper->setSeries(m_series); - mapper->setFirst(first); - mapper->setCount(countLimit); + mapper->setFirstRow(first); + mapper->setRowCount(countLimit); m_chart->addSeries(m_series); QCOMPARE(m_series->count(), expectedBarSetCount); @@ -313,8 +313,8 @@ void tst_qbarmodelmapper::horizontalMapperCustomMapping() mapper->setLastBarSetRow(1); mapper->setModel(m_model); mapper->setSeries(m_series); - mapper->setFirst(first); - mapper->setCount(countLimit); + mapper->setFirstColumn(first); + mapper->setColumnCount(countLimit); m_chart->addSeries(m_series); QCOMPARE(m_series->count(), expectedBarSetCount); @@ -337,15 +337,15 @@ void tst_qbarmodelmapper::seriesUpdated() // setup the mapper createVerticalMapper(); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); - QCOMPARE(m_vMapper->count(), -1); + QCOMPARE(m_vMapper->rowCount(), -1); m_series->barSets().first()->append(123); QCOMPARE(m_model->rowCount(), m_modelRowCount + 1); - QCOMPARE(m_vMapper->count(), -1); // the value should not change as it indicates 'all' items there are in the model + QCOMPARE(m_vMapper->rowCount(), -1); // the value should not change as it indicates 'all' items there are in the model m_series->barSets().last()->remove(0, m_modelRowCount); QCOMPARE(m_model->rowCount(), 1); - QCOMPARE(m_vMapper->count(), -1); // the value should not change as it indicates 'all' items there are in the model + QCOMPARE(m_vMapper->rowCount(), -1); // the value should not change as it indicates 'all' items there are in the model m_series->barSets().first()->replace(0, 444.0); QCOMPARE(m_model->data(m_model->index(0, 0)).toReal(), 444.0); @@ -389,7 +389,7 @@ void tst_qbarmodelmapper::verticalModelInsertRows() QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount); int first = 3; - m_vMapper->setFirst(3); + m_vMapper->setFirstRow(3); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount - first); @@ -398,7 +398,7 @@ void tst_qbarmodelmapper::verticalModelInsertRows() QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 2 * insertCount - first); int countLimit = 6; - m_vMapper->setCount(countLimit); + m_vMapper->setRowCount(countLimit); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 2 * insertCount - first)); @@ -406,11 +406,11 @@ void tst_qbarmodelmapper::verticalModelInsertRows() QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount - first)); - m_vMapper->setFirst(0); + m_vMapper->setFirstRow(0); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount)); - m_vMapper->setCount(-1); + m_vMapper->setRowCount(-1); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 3 * insertCount); } @@ -429,7 +429,7 @@ void tst_qbarmodelmapper::verticalModelRemoveRows() QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount); int first = 1; - m_vMapper->setFirst(first); + m_vMapper->setFirstRow(first); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount - first); @@ -438,7 +438,7 @@ void tst_qbarmodelmapper::verticalModelRemoveRows() QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 2 * removeCount - first); int countLimit = 3; - m_vMapper->setCount(countLimit); + m_vMapper->setRowCount(countLimit); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 2 * removeCount - first)); @@ -446,11 +446,11 @@ void tst_qbarmodelmapper::verticalModelRemoveRows() QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount - first)); - m_vMapper->setFirst(0); + m_vMapper->setFirstRow(0); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount)); - m_vMapper->setCount(-1); + m_vMapper->setRowCount(-1); QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 3 * removeCount); } @@ -533,7 +533,7 @@ void tst_qbarmodelmapper::horizontalModelInsertColumns() QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount); int first = 3; - m_hMapper->setFirst(3); + m_hMapper->setFirstColumn(3); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount - first); @@ -542,7 +542,7 @@ void tst_qbarmodelmapper::horizontalModelInsertColumns() QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 2 * insertCount - first); int countLimit = 6; - m_hMapper->setCount(countLimit); + m_hMapper->setColumnCount(countLimit); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 2 * insertCount - first)); @@ -550,11 +550,11 @@ void tst_qbarmodelmapper::horizontalModelInsertColumns() QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount - first)); - m_hMapper->setFirst(0); + m_hMapper->setFirstColumn(0); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount)); - m_hMapper->setCount(-1); + m_hMapper->setColumnCount(-1); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 3 * insertCount); } @@ -573,7 +573,7 @@ void tst_qbarmodelmapper::horizontalModelRemoveColumns() QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount); int first = 1; - m_hMapper->setFirst(first); + m_hMapper->setFirstColumn(first); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount - first); @@ -582,7 +582,7 @@ void tst_qbarmodelmapper::horizontalModelRemoveColumns() QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 2 * removeCount - first); int countLimit = 3; - m_hMapper->setCount(countLimit); + m_hMapper->setColumnCount(countLimit); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 2 * removeCount - first)); @@ -590,11 +590,11 @@ void tst_qbarmodelmapper::horizontalModelRemoveColumns() QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount - first)); - m_hMapper->setFirst(0); + m_hMapper->setFirstColumn(0); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount)); - m_hMapper->setCount(-1); + m_hMapper->setColumnCount(-1); QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 3 * removeCount); }