diff --git a/src/barchart/qbarmodelmapper.cpp b/src/barchart/qbarmodelmapper.cpp index a27f994..67eff3a 100644 --- a/src/barchart/qbarmodelmapper.cpp +++ b/src/barchart/qbarmodelmapper.cpp @@ -120,9 +120,7 @@ void QBarModelMapper::setSeries(QBarSeries *series) d->m_series = series; d->initializeBarFromModel(); // connect the signals from the 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))); + // TODO: TO be implemented } int QBarModelMapper::first() const @@ -382,69 +380,17 @@ void QBarModelMapperPrivate::modelColumnsRemoved(QModelIndex parent, int start, void QBarModelMapperPrivate::insertData(int start, int end) { Q_UNUSED(end) - if (m_model == 0 || m_series == 0) - return; - - if (m_count != -1 && start >= m_first + m_count) { - return; - } /*else { - int addedCount = end - start + 1; - if (m_count != -1 && addedCount > m_count) - addedCount = m_count; - int first = qMax(start, m_first); - int last = qMin(first + addedCount - 1, m_orientation == Qt::Vertical ? m_model->rowCount() - 1 : m_model->columnCount() - 1); - for (int k = 0; k < m_series->barSets().count(); k++) { - for (int i = first; i <= last; i++) { - QBar point; - point.setX(m_model->data(xModelIndex(i - m_first), Qt::DisplayRole).toDouble()); - point.setY(m_model->data(yModelIndex(i - m_first), Qt::DisplayRole).toDouble()); - m_series->insert(i - m_first, point); - } ->>>>>>> Stashed changes - } - - // remove excess of slices (abouve m_count) - if (m_count != -1 && m_series->points().size() > m_count) - for (int i = m_series->points().size() - 1; i >= m_count; i--) { - m_series->remove(m_series->points().at(i)); - } - }*/ + Q_UNUSED(start) + Q_UNUSED(end) + // To be implemented } void QBarModelMapperPrivate::removeData(int start, int end) { Q_UNUSED(end) - if (m_model == 0 || m_series == 0) - return; - - // int removedCount = end - start + 1; - if (m_count != -1 && start >= m_first + m_count) { - return; - } /*else { - int toRemove = qMin(m_series->count(), removedCount); // first find how many items can actually be removed - int first = qMax(start, m_first); // get the index of the first item that will be removed. - int last = qMin(first + toRemove - 1, m_series->count() + m_first - 1); // get the index of the last item that will be removed. - for (int i = last; i >= first; i--) { - m_series->remove(m_series->points().at(i - m_first)); - } - - if (m_count != -1) { - int itemsAvailable; // check how many are available to be added - if (m_orientation == Qt::Vertical) - itemsAvailable = m_model->rowCount() - m_first - m_series->count(); - else - itemsAvailable = m_model->columnCount() - m_first - m_series->count(); - int toBeAdded = qMin(itemsAvailable, m_count - m_series->count()); // add not more items than there is space left to be filled. - int currentSize = m_series->count(); - if (toBeAdded > 0) - for (int i = m_series->count(); i < currentSize + toBeAdded; i++) { - QPointF point; - point.setX(m_model->data(xModelIndex(i), Qt::DisplayRole).toDouble()); - point.setY(m_model->data(yModelIndex(i), Qt::DisplayRole).toDouble()); - m_series->insert(i, point); - } - } - }*/ + Q_UNUSED(start) + Q_UNUSED(end) + // To be implemented } void QBarModelMapperPrivate::initializeBarFromModel() diff --git a/src/barchart/qbarmodelmapper_p.h b/src/barchart/qbarmodelmapper_p.h index dc99205..63b8fd2 100644 --- a/src/barchart/qbarmodelmapper_p.h +++ b/src/barchart/qbarmodelmapper_p.h @@ -54,11 +54,6 @@ public Q_SLOTS: void modelColumnsAdded(QModelIndex parent, int start, int end); void modelColumnsRemoved(QModelIndex parent, int start, int end); -// // for the series -// void handlePointAdded(int pointPos); -// void handlePointRemoved(int pointPos); -// void handlePointReplaced(int pointPos); - void initializeBarFromModel(); private: diff --git a/src/piechart/qhpiemodelmapper.h b/src/piechart/qhpiemodelmapper.h index ab0bcd4..30463e7 100644 --- a/src/piechart/qhpiemodelmapper.h +++ b/src/piechart/qhpiemodelmapper.h @@ -39,7 +39,6 @@ public: int labelsRow() const; void setLabelsRow(int labelsRow); - }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/piechart/qpiemodelmapper.cpp b/src/piechart/qpiemodelmapper.cpp index 2a8410e..eec9034 100644 --- a/src/piechart/qpiemodelmapper.cpp +++ b/src/piechart/qpiemodelmapper.cpp @@ -27,6 +27,16 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! + \class QPieModelMapper + \brief part of QtCommercial chart API. + \mainclass + + The instance of this class cannot be created directly. QHPieModelMapper of QVPieModelMapper should be used instead. This class is used to create a connection between QPieSeries and QAbstractItemModel derived model object. + It is possible to use both QAbstractItemModel and QPieSeries model API. QPieModelMapper makes sure that Pie 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 QPieModelMapper::series \brief Defines the QPieSeries object that is used by the mapper. @@ -54,16 +64,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \class QPieModelMapper - \brief part of QtCommercial chart API. - \mainclass - - The instance of this class cannot be created directly. QHPieModelMapper of QVPieModelMapper should be used instead. This class is used to create a connection between QPieSeries and QAbstractItemModel derived model object. - It is possible to use both QAbstractItemModel and QPieSeries model API. QPieModelMapper makes sure that Pie and the model are kept in sync. - NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. -*/ - -/*! Constructs a mapper object which is a child of \a parent. */ QPieModelMapper::QPieModelMapper(QObject *parent) : @@ -581,7 +581,6 @@ void QPieModelMapperPrivate::initializePieFromModel() connect(slice, SIGNAL(valueChanged()), this, SLOT(sliceValueChanged())); m_series->append(slice); m_slices.append(slice); - // m_series->append(m_model->data(labelIndex, Qt::DisplayRole).toString(), m_model->data(valueIndex, Qt::DisplayRole).toDouble()); slicePos++; valueIndex = valueModelIndex(slicePos); labelIndex = labelModelIndex(slicePos); diff --git a/src/xychart/qhxymodelmapper.h b/src/xychart/qhxymodelmapper.h index b836d9f..b4c3177 100644 --- a/src/xychart/qhxymodelmapper.h +++ b/src/xychart/qhxymodelmapper.h @@ -38,8 +38,7 @@ public: void setXRow(int xRow); int yRow() const; - void setYRow(int yRow); - + void setYRow(int yRow); }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/xychart/qvxymodelmapper.cpp b/src/xychart/qvxymodelmapper.cpp index 508133f..62a7d85 100644 --- a/src/xychart/qvxymodelmapper.cpp +++ b/src/xychart/qvxymodelmapper.cpp @@ -27,7 +27,9 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief part of QtCommercial chart API. \mainclass - Nothing here yet + Vertical model mapper 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. */ /*! diff --git a/src/xychart/qvxymodelmapper.h b/src/xychart/qvxymodelmapper.h index 5e37606..4645a75 100644 --- a/src/xychart/qvxymodelmapper.h +++ b/src/xychart/qvxymodelmapper.h @@ -38,8 +38,7 @@ public: void setXColumn(int xColumn); int yColumn() const; - void setYColumn(int yColumn); - + void setYColumn(int yColumn); }; QTCOMMERCIALCHART_END_NAMESPACE