From 4d1b1b063da843441d30269f95ed59ceef9ee9d5 2012-06-20 09:44:51 From: Marek Rosa Date: 2012-06-20 09:44:51 Subject: [PATCH] QXYModelMapper removed from the docs --- diff --git a/demos/qmlcustommodel/qml/qmlcustommodel/main.qml b/demos/qmlcustommodel/qml/qmlcustommodel/main.qml index 31d3145..02d0f31 100644 --- a/demos/qmlcustommodel/qml/qmlcustommodel/main.qml +++ b/demos/qmlcustommodel/qml/qmlcustommodel/main.qml @@ -75,7 +75,7 @@ Rectangle { model: customModel xRow: 0 yRow: 1 - first: 2 + firstColumn: 2 } } //![4] @@ -87,7 +87,7 @@ Rectangle { model: customModel xRow: 0 yRow: 2 - first: 2 + firstColumn: 2 } } @@ -98,7 +98,7 @@ Rectangle { model: customModel xRow: 0 yRow: 3 - first: 2 + firstColumn: 2 } } @@ -109,7 +109,7 @@ Rectangle { model: customModel xRow: 0 yRow: 4 - first: 2 + firstColumn: 2 } } @@ -120,7 +120,7 @@ Rectangle { model: customModel xRow: 0 yRow: 5 - first: 2 + firstColumn: 2 } } diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc index aee8165..d5c57f3 100644 --- a/doc/src/classes.qdoc +++ b/doc/src/classes.qdoc @@ -52,11 +52,11 @@ diff --git a/src/xychart/qhxymodelmapper.cpp b/src/xychart/qhxymodelmapper.cpp index 9a16ede..8467168 100644 --- a/src/xychart/qhxymodelmapper.cpp +++ b/src/xychart/qhxymodelmapper.cpp @@ -24,7 +24,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \class QHXYModelMapper - \brief part of QtCommercial chart API. \mainclass Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. @@ -34,6 +33,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QHXYModelMapper::series + \brief Defines the QXYSeries object that is used by the mapper. + + All the data in the series is discarded when it is set to the mapper. + When new series is specified the old series is disconnected (it preserves its data) +*/ + +/*! + \property QHXYModelMapper::model + \brief Defines the model that is used by the mapper. +*/ + +/*! \property QHXYModelMapper::xRow \brief Defines which row of the model is kept in sync with the x values of the QXYSeries Default value is: -1 (invalid mapping) @@ -47,6 +59,40 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QHXYModelMapper::firstColumn + \brief Defines which column of the model contains the data for the first point of the series. + Minimal and default value is: 0 +*/ +/*! + \qmlproperty int QHXYModelMapper::firstColumn + Defines which column of the model contains the data for the first point of the series. + The default value is 0. +*/ + +/*! + \property QHXYModelMapper::columnCount + \brief Defines the number of columns of the model that are mapped as the data for series + Minimal and default value is: -1 (count limited by the number of columns in the model) +*/ +/*! + \qmlproperty int QHXYModelMapper::columnCount + Defines the number of columns of the model that are mapped as the data for series. The default value is + -1 (count limited by the number of columns in the model) +*/ + +/*! + \fn void QHXYModelMapper::seriesReplaced() + + Emitted when the series to which mapper is connected to has changed. +*/ + +/*! + \fn void QHXYModelMapper::modelReplaced() + + Emitted when the model to which mapper is connected to has changed. +*/ + +/*! \fn void QHXYModelMapper::xRowChanged() Emitted when the xRow has changed. @@ -59,6 +105,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QHXYModelMapper::firstColumnChanged() + Emitted when the firstColumn has changed. +*/ + +/*! + \fn void QHXYModelMapper::columnCountChanged() + Emitted when the columnCount has changed. +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QHXYModelMapper::QHXYModelMapper(QObject *parent) : @@ -67,6 +123,32 @@ QHXYModelMapper::QHXYModelMapper(QObject *parent) : QXYModelMapper::setOrientation(Qt::Horizontal); } +QAbstractItemModel* QHXYModelMapper::model() const +{ + return QXYModelMapper::model(); +} + +void QHXYModelMapper::setModel(QAbstractItemModel *model) +{ + if (model != QXYModelMapper::model()) { + QXYModelMapper::setModel(model); + emit modelReplaced(); + } +} + +QXYSeries* QHXYModelMapper::series() const +{ + return QXYModelMapper::series(); +} + +void QHXYModelMapper::setSeries(QXYSeries *series) +{ + if (series != QXYModelMapper::series()) { + QXYModelMapper::setSeries(series); + emit seriesReplaced(); + } +} + int QHXYModelMapper::xRow() const { return QXYModelMapper::xSection(); @@ -93,6 +175,32 @@ void QHXYModelMapper::setYRow(int yRow) } } +int QHXYModelMapper::firstColumn() const +{ + return first(); +} + +void QHXYModelMapper::setFirstColumn(int firstColumn) +{ + if (firstColumn != first()) { + setFirst(firstColumn); + emit firstColumnChanged(); + } +} + +int QHXYModelMapper::columnCount() const +{ + return count(); +} + +void QHXYModelMapper::setColumnCount(int columnCount) +{ + if (columnCount != count()) { + setCount(columnCount); + emit firstColumnChanged(); + } +} + #include "moc_qhxymodelmapper.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/xychart/qhxymodelmapper.h b/src/xychart/qhxymodelmapper.h index e0bb02c..b6e5116 100644 --- a/src/xychart/qhxymodelmapper.h +++ b/src/xychart/qhxymodelmapper.h @@ -28,11 +28,21 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QTCOMMERCIALCHART_EXPORT QHXYModelMapper : public QXYModelMapper { Q_OBJECT + Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced) + Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced) Q_PROPERTY(int xRow READ xRow WRITE setXRow NOTIFY xRowChanged) Q_PROPERTY(int yRow READ yRow WRITE setYRow NOTIFY yRowChanged) + Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged) + Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged) public: explicit QHXYModelMapper(QObject *parent = 0); + + QAbstractItemModel* model() const; + void setModel(QAbstractItemModel *model); + + QXYSeries* series() const; + void setSeries(QXYSeries *series); int xRow() const; void setXRow(int xRow); @@ -40,9 +50,19 @@ public: int yRow() const; void setYRow(int yRow); + int firstColumn() const; + void setFirstColumn(int firstColumn); + + int columnCount() const; + void setColumnCount(int columnCount); + Q_SIGNALS: + void seriesReplaced(); + void modelReplaced(); void xRowChanged(); void yRowChanged(); + void firstColumnChanged(); + void columnCountChanged(); }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/xychart/qvxymodelmapper.cpp b/src/xychart/qvxymodelmapper.cpp index d54f44e..f33bd2e 100644 --- a/src/xychart/qvxymodelmapper.cpp +++ b/src/xychart/qvxymodelmapper.cpp @@ -24,7 +24,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \class QVXYModelMapper - \brief part of QtCommercial chart API. \mainclass Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. @@ -34,6 +33,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QVXYModelMapper::series + \brief Defines the QXYSeries object that is used by the mapper. + + All the data in the series is discarded when it is set to the mapper. + When new series is specified the old series is disconnected (it preserves its data) +*/ + +/*! + \property QVXYModelMapper::model + \brief Defines the model that is used by the mapper. +*/ + +/*! \property QVXYModelMapper::xColumn \brief Defines which column of the model is kept in sync with the x values of QXYSeries @@ -48,6 +60,40 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QVXYModelMapper::firstRow + \brief Defines which row of the model contains the data for the first point of the series. + Minimal and default value is: 0 +*/ +/*! + \qmlproperty int QVXYModelMapper::firstRow + Defines which row of the model contains the data for the first point of the series. + The default value is 0. +*/ + +/*! + \property QVXYModelMapper::rowCount + \brief Defines the number of rows of the model that are mapped as the data for series + Minimal and default value is: -1 (count limited by the number of rows in the model) +*/ +/*! + \qmlproperty int QVXYModelMapper::columnCount + Defines the number of rows of the model that are mapped as the data for series. The default value is + -1 (count limited by the number of rows in the model) +*/ + +/*! + \fn void QVXYModelMapper::seriesReplaced() + + Emitted when the series to which mapper is connected to has changed. +*/ + +/*! + \fn void QVXYModelMapper::modelReplaced() + + Emitted when the model to which mapper is connected to has changed. +*/ + +/*! \fn void QVXYModelMapper::xColumnChanged() Emitted when the xColumn has changed. @@ -60,6 +106,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QVXYModelMapper::firstRowChanged() + Emitted when the firstRow has changed. +*/ + +/*! + \fn void QVXYModelMapper::rowCountChanged() + Emitted when the rowCount has changed. +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QVXYModelMapper::QVXYModelMapper(QObject *parent) : @@ -68,6 +124,32 @@ QVXYModelMapper::QVXYModelMapper(QObject *parent) : QXYModelMapper::setOrientation(Qt::Vertical); } +QAbstractItemModel* QVXYModelMapper::model() const +{ + return QXYModelMapper::model(); +} + +void QVXYModelMapper::setModel(QAbstractItemModel *model) +{ + if (model != QXYModelMapper::model()) { + QXYModelMapper::setModel(model); + emit modelReplaced(); + } +} + +QXYSeries* QVXYModelMapper::series() const +{ + return QXYModelMapper::series(); +} + +void QVXYModelMapper::setSeries(QXYSeries *series) +{ + if (series != QXYModelMapper::series()) { + QXYModelMapper::setSeries(series); + emit seriesReplaced(); + } +} + int QVXYModelMapper::xColumn() const { return QXYModelMapper::xSection(); @@ -94,6 +176,32 @@ void QVXYModelMapper::setYColumn(int yColumn) } } +int QVXYModelMapper::firstRow() const +{ + return first(); +} + +void QVXYModelMapper::setFirstRow(int firstRow) +{ + if (firstRow != first()) { + setFirst(firstRow); + emit firstRowChanged(); + } +} + +int QVXYModelMapper::rowCount() const +{ + return count(); +} + +void QVXYModelMapper::setRowCount(int rowCount) +{ + if (rowCount != count()) { + setCount(rowCount); + emit firstRowChanged(); + } +} + #include "moc_qvxymodelmapper.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/xychart/qvxymodelmapper.h b/src/xychart/qvxymodelmapper.h index b30f46a..ead5e05 100644 --- a/src/xychart/qvxymodelmapper.h +++ b/src/xychart/qvxymodelmapper.h @@ -28,11 +28,21 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QTCOMMERCIALCHART_EXPORT QVXYModelMapper : public QXYModelMapper { Q_OBJECT + Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced) + Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced) Q_PROPERTY(int xColumn READ xColumn WRITE setXColumn NOTIFY xColumnChanged) Q_PROPERTY(int yColumn READ yColumn WRITE setYColumn NOTIFY yColumnChanged) + Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged) + Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged) public: explicit QVXYModelMapper(QObject *parent = 0); + + QAbstractItemModel* model() const; + void setModel(QAbstractItemModel *model); + + QXYSeries* series() const; + void setSeries(QXYSeries *series); int xColumn() const; void setXColumn(int xColumn); @@ -40,9 +50,19 @@ public: int yColumn() const; void setYColumn(int yColumn); + int firstRow() const; + void setFirstRow(int firstRow); + + int rowCount() const; + void setRowCount(int rowCount); + Q_SIGNALS: + void seriesReplaced(); + void modelReplaced(); void xColumnChanged(); void yColumnChanged(); + void firstRowChanged(); + void rowCountChanged(); }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/xychart/qxymodelmapper.cpp b/src/xychart/qxymodelmapper.cpp index 77549e8..9db2f8f 100644 --- a/src/xychart/qxymodelmapper.cpp +++ b/src/xychart/qxymodelmapper.cpp @@ -26,68 +26,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! - \class QXYModelMapper - \brief part of QtCommercial chart API. - \mainclass - - Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. - The instance of this class cannot be created directly. QHXYModelMapper of QVXYModelMapper should be used instead. This class is used to create a connection between QXYSeries and QAbstractItemModel derived model object. - It is possible to use both QAbstractItemModel and QXYSeries model API. QXYModelMapper makes sure that QXYSeries and the model are kept in sync. - NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. -*/ - -/*! - \property QXYModelMapper::series - \brief Defines the QPieSeries object that is used by the mapper. - - All the data in the series is discarded when it is set to the mapper. - When new series is specified the old series is disconnected (it preserves its data) -*/ - -/*! - \property QXYModelMapper::model - \brief Defines the model that is used by the mapper. -*/ - -/*! - \property QXYModelMapper::first - \brief Defines which item of the model's row/column should be mapped as the first x/y pair - - Minimal and default value is: 0 -*/ - -/*! - \property QXYModelMapper::count - \brief Defines the number of rows/columns of the model that are mapped as the data for QXYSeries - - Minimal and default value is: -1 (count limited by the number of rows/columns in the model) -*/ - -/*! - \fn void QXYModelMapper::seriesReplaced() - - Emitted when the series to which mapper is connected to has changed. -*/ - -/*! - \fn void QXYModelMapper::modelReplaced() - - Emitted when the model to which mapper is connected to has changed. -*/ - -/*! - \fn void QXYModelMapper::firstChanged() - - Emitted when the value for the first has changed. -*/ - -/*! - \fn void QXYModelMapper::countChanged() - - Emitted when the value for the count has changed. -*/ - -/*! Constructs a mapper object which is a child of \a parent. */ QXYModelMapper::QXYModelMapper(QObject *parent): @@ -96,12 +34,18 @@ QXYModelMapper::QXYModelMapper(QObject *parent): { } +/*! + \internal +*/ QAbstractItemModel* QXYModelMapper::model() const { Q_D(const QXYModelMapper); return d->m_model; } +/*! + \internal +*/ void QXYModelMapper::setModel(QAbstractItemModel *model) { if (model == 0) @@ -120,16 +64,20 @@ void QXYModelMapper::setModel(QAbstractItemModel *model) connect(d->m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), d, SLOT(modelRowsRemoved(QModelIndex,int,int))); connect(d->m_model, SIGNAL(columnsInserted(QModelIndex,int,int)), d, SLOT(modelColumnsAdded(QModelIndex,int,int))); connect(d->m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)), d, SLOT(modelColumnsRemoved(QModelIndex,int,int))); - - emit modelReplaced(); } +/*! + \internal +*/ QXYSeries* QXYModelMapper::series() const { Q_D(const QXYModelMapper); return d->m_series; } +/*! + \internal +*/ void QXYModelMapper::setSeries(QXYSeries *series) { Q_D(QXYModelMapper); @@ -146,42 +94,44 @@ void QXYModelMapper::setSeries(QXYSeries *series) connect(d->m_series, SIGNAL(pointAdded(int)), d, SLOT(handlePointAdded(int))); connect(d->m_series, SIGNAL(pointRemoved(int)), d, SLOT(handlePointRemoved(int))); connect(d->m_series, SIGNAL(pointReplaced(int)), d, SLOT(handlePointReplaced(int))); - - emit seriesReplaced(); } +/*! + \internal +*/ int QXYModelMapper::first() const { Q_D(const QXYModelMapper); return d->m_first; } +/*! + \internal +*/ void QXYModelMapper::setFirst(int first) { Q_D(QXYModelMapper); - if (first != d->m_first) { - d->m_first = qMax(first, 0); - d->initializeXYFromModel(); - - emit firstChanged(); - } + d->m_first = qMax(first, 0); + d->initializeXYFromModel(); } +/*! + \internal +*/ int QXYModelMapper::count() const { Q_D(const QXYModelMapper); return d->m_count; } +/*! + \internal +*/ void QXYModelMapper::setCount(int count) { Q_D(QXYModelMapper); - if (count != d->m_count) { - d->m_count = qMax(count, -1); - d->initializeXYFromModel(); - - emit countChanged(); - } + d->m_count = qMax(count, -1); + d->initializeXYFromModel(); } /*! @@ -247,21 +197,6 @@ void QXYModelMapper::setYSection(int ySection) d->initializeXYFromModel(); } -/*! - Resets the QXYModelMapper to the default state. - first: 0; count: -1; xSection: -1; ySection: -1; -*/ -void QXYModelMapper::reset() -{ - Q_D(QXYModelMapper); - d->m_first = 0; - d->m_count = -1; - d->m_orientation = Qt::Vertical; - d->m_xSection = -1; - d->m_ySection = -1; - d->initializeXYFromModel(); -} - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QXYModelMapperPrivate::QXYModelMapperPrivate(QXYModelMapper *q) : diff --git a/src/xychart/qxymodelmapper.h b/src/xychart/qxymodelmapper.h index a01ac80..f74c47c 100644 --- a/src/xychart/qxymodelmapper.h +++ b/src/xychart/qxymodelmapper.h @@ -34,16 +34,10 @@ class QXYSeries; class QTCOMMERCIALCHART_EXPORT QXYModelMapper : public QObject { Q_OBJECT - Q_PROPERTY(QXYSeries *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: explicit QXYModelMapper(QObject *parent = 0); -public: QAbstractItemModel* model() const; void setModel(QAbstractItemModel *model); @@ -56,9 +50,6 @@ public: int count() const; void setCount(int count); - void reset(); - -protected: Qt::Orientation orientation() const; void setOrientation(Qt::Orientation orientation); @@ -68,12 +59,6 @@ protected: int ySection() const; void setYSection(int ySection); -Q_SIGNALS: - void seriesReplaced(); - void modelReplaced(); - void firstChanged(); - void countChanged(); - protected: QXYModelMapperPrivate * const d_ptr; Q_DECLARE_PRIVATE(QXYModelMapper) diff --git a/tests/auto/qxymodelmapper/tst_qxymodelmapper.cpp b/tests/auto/qxymodelmapper/tst_qxymodelmapper.cpp index 28a1f3f..4aa033c 100644 --- a/tests/auto/qxymodelmapper/tst_qxymodelmapper.cpp +++ b/tests/auto/qxymodelmapper/tst_qxymodelmapper.cpp @@ -218,8 +218,8 @@ void tst_qxymodelmapper::verticalMapperCustomMapping() mapper->setYColumn(1); mapper->setModel(m_model); mapper->setSeries(m_series); - mapper->setFirst(first); - mapper->setCount(countLimit); + mapper->setFirstRow(first); + mapper->setRowCount(countLimit); QCOMPARE(m_series->count(), expectedCount); @@ -295,8 +295,8 @@ void tst_qxymodelmapper::horizontalMapperCustomMapping() mapper->setYRow(1); mapper->setModel(m_model); mapper->setSeries(m_series); - mapper->setFirst(first); - mapper->setCount(countLimit); + mapper->setFirstColumn(first); + mapper->setColumnCount(countLimit); QCOMPARE(m_series->count(), expectedCount); @@ -315,15 +315,15 @@ void tst_qxymodelmapper::seriesUpdated() // setup the mapper createVerticalMapper(); QCOMPARE(m_series->count(), m_modelRowCount); - QCOMPARE(m_vMapper->count(), -1); + QCOMPARE(m_vMapper->rowCount(), -1); m_series->append(QPointF(100, 100)); QCOMPARE(m_series->count(), 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->remove(m_series->points().last()); QCOMPARE(m_series->count(), m_modelRowCount); - 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->replace(m_series->points().first(), QPointF(25.0, 75.0)); QCOMPARE(m_model->data(m_model->index(0, 0)).toReal(), 25.0); @@ -342,23 +342,23 @@ void tst_qxymodelmapper::verticalModelInsertRows() QCOMPARE(m_series->count(), m_modelRowCount + insertCount); int first = 3; - m_vMapper->setFirst(3); + m_vMapper->setFirstRow(3); QCOMPARE(m_series->count(), m_modelRowCount + insertCount - first); m_model->insertRows(3, insertCount); QCOMPARE(m_series->count(), m_modelRowCount + 2 * insertCount - first); int countLimit = 6; - m_vMapper->setCount(countLimit); + m_vMapper->setRowCount(countLimit); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount + 2 * insertCount - first)); m_model->insertRows(3, insertCount); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount - first)); - m_vMapper->setFirst(0); + m_vMapper->setFirstRow(0); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount)); - m_vMapper->setCount(-1); + m_vMapper->setRowCount(-1); QCOMPARE(m_series->count(), m_modelRowCount + 3 * insertCount); } @@ -374,23 +374,23 @@ void tst_qxymodelmapper::verticalModelRemoveRows() QCOMPARE(m_series->count(), m_modelRowCount - removeCount); int first = 1; - m_vMapper->setFirst(first); + m_vMapper->setFirstRow(first); QCOMPARE(m_series->count(), m_modelRowCount - removeCount - first); m_model->removeRows(1, removeCount); QCOMPARE(m_series->count(), m_modelRowCount - 2 * removeCount - first); int countLimit = 3; - m_vMapper->setCount(countLimit); + m_vMapper->setRowCount(countLimit); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount - 2 * removeCount - first)); m_model->removeRows(1, removeCount); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount - first)); - m_vMapper->setFirst(0); + m_vMapper->setFirstRow(0); QCOMPARE(m_series->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount)); - m_vMapper->setCount(-1); + m_vMapper->setRowCount(-1); QCOMPARE(m_series->count(), m_modelRowCount - 3 * removeCount); } @@ -462,23 +462,23 @@ void tst_qxymodelmapper::horizontalModelInsertColumns() QCOMPARE(m_series->count(), m_modelColumnCount + insertCount); int first = 3; - m_hMapper->setFirst(3); + m_hMapper->setFirstColumn(3); QCOMPARE(m_series->count(), m_modelColumnCount + insertCount - first); m_model->insertColumns(3, insertCount); QCOMPARE(m_series->count(), m_modelColumnCount + 2 * insertCount - first); int countLimit = 6; - m_hMapper->setCount(countLimit); + m_hMapper->setColumnCount(countLimit); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount + 2 * insertCount - first)); m_model->insertColumns(3, insertCount); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount - first)); - m_hMapper->setFirst(0); + m_hMapper->setFirstColumn(0); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount)); - m_hMapper->setCount(-1); + m_hMapper->setColumnCount(-1); QCOMPARE(m_series->count(), m_modelColumnCount + 3 * insertCount); } @@ -494,23 +494,23 @@ void tst_qxymodelmapper::horizontalModelRemoveColumns() QCOMPARE(m_series->count(), m_modelColumnCount - removeCount); int first = 1; - m_hMapper->setFirst(first); + m_hMapper->setFirstColumn(first); QCOMPARE(m_series->count(), m_modelColumnCount - removeCount - first); m_model->removeColumns(1, removeCount); QCOMPARE(m_series->count(), m_modelColumnCount - 2 * removeCount - first); int countLimit = 3; - m_hMapper->setCount(countLimit); + m_hMapper->setColumnCount(countLimit); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount - 2 * removeCount - first)); m_model->removeColumns(1, removeCount); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount - first)); - m_hMapper->setFirst(0); + m_hMapper->setFirstColumn(0); QCOMPARE(m_series->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount)); - m_hMapper->setCount(-1); + m_hMapper->setColumnCount(-1); QCOMPARE(m_series->count(), m_modelColumnCount - 3 * removeCount); }