From cfecc74c9bfaf0aa320af6edea0edfd5154d4851 2012-03-27 06:12:44 From: Marek Rosa Date: 2012-03-27 06:12:44 Subject: [PATCH] XYSeries: added support for limited mapping area --- diff --git a/examples/tablemodelchart/customtablemodel.cpp b/examples/tablemodelchart/customtablemodel.cpp index 7c71b37..0918a98 100644 --- a/examples/tablemodelchart/customtablemodel.cpp +++ b/examples/tablemodelchart/customtablemodel.cpp @@ -1,22 +1,25 @@ #include "customtablemodel.h" #include +#include CustomTableModel::CustomTableModel(QObject *parent) : QAbstractTableModel(parent) { -// m_points.append(QPointF(10, 50)); -// m_labels.append("Apples"); -// m_points.append(QPointF(60, 70)); -// m_labels.append("Oranges"); -// m_points.append(QPointF(110, 50)); -// m_labels.append("Bananas"); -// m_points.append(QPointF(140, 40)); -// m_labels.append("Lemons"); -// m_points.append(QPointF(200, 150)); -// m_labels.append("Plums"); -// m_points.append(QPointF(225, 75)); + // m_points.append(QPointF(10, 50)); + // m_labels.append("Apples"); + // m_points.append(QPointF(60, 70)); + // m_labels.append("Oranges"); + // m_points.append(QPointF(110, 50)); + // m_labels.append("Bananas"); + // m_points.append(QPointF(140, 40)); + // m_labels.append("Lemons"); + // m_points.append(QPointF(200, 150)); + // m_labels.append("Plums"); + // m_points.append(QPointF(225, 75)); // m_labels.append("Pearls"); + qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); + // m_data for (int i = 0; i < 6; i++) { @@ -168,10 +171,17 @@ bool CustomTableModel::insertRows ( int row, int count, const QModelIndex & pare dataVec->replace(k, m_data[row - 1]->at(k) + qrand()%qMax(1, difference)); } else - dataVec->replace(k, qrand()%20); + dataVec->replace(k, qrand()%40 + 10); } else - dataVec->replace(k, m_data[row - 1]->at(k) + qrand()%20); + if (row - 1 >= 0) + { + dataVec->replace(k, m_data[row - 1]->at(k) + qrand()%40 + 10); + } + else + { + dataVec->replace(k, qrand()%40 + 10); + } } else dataVec->replace(k, qrand()%100); @@ -193,7 +203,7 @@ bool CustomTableModel::removeRows ( int row, int count, const QModelIndex & pare beginRemoveRows(parent, row, row + count - 1); for (int i = row; i < row + count; i++) { -// m_points.removeAt(row); + // m_points.removeAt(row); QVector* item = m_data.at(row); m_data.removeAt(row); delete item; diff --git a/examples/tablemodelchart/tablewidget.cpp b/examples/tablemodelchart/tablewidget.cpp index d95943f..9b8d54b 100644 --- a/examples/tablemodelchart/tablewidget.cpp +++ b/examples/tablemodelchart/tablewidget.cpp @@ -126,6 +126,7 @@ void TableWidget::updateChartType() series = new QLineSeries; series->setModel(m_model); series->setModelMapping(0,1, Qt::Vertical); + series->setModelMappingShift(1, 4); // series->setModelMapping(0,1, Qt::Horizontal); chartView->addSeries(series); @@ -136,19 +137,20 @@ void TableWidget::updateChartType() // series->setModelMapping(2,3, Qt::Horizontal); chartView->addSeries(series); - // series 3 - series = new QLineSeries; - series->setModel(m_model); - series->setModelMapping(4,5, Qt::Vertical); -// series->setModelMapping(4,5, Qt::Horizontal); - chartView->addSeries(series); +// // series 3 +// series = new QLineSeries; +// series->setModel(m_model); +// series->setModelMapping(4,5, Qt::Vertical); +//// series->setModelMapping(4,5, Qt::Horizontal); +// chartView->addSeries(series); } else if (splineRadioButton->isChecked()) { // series 1 series = new QSplineSeries; - series->setModel(m_model); - series->setModelMapping(0,1, Qt::Vertical); + series->setModel(m_model); + series->setModelMapping(0,1, Qt::Vertical); + series->setModelMappingShift(1, 4); // series->setModelMapping(0,1, Qt::Horizontal); chartView->addSeries(series); diff --git a/src/barchart/qbarseries.cpp b/src/barchart/qbarseries.cpp index 9bb99c4..80fafce 100644 --- a/src/barchart/qbarseries.cpp +++ b/src/barchart/qbarseries.cpp @@ -41,6 +41,8 @@ QBarSeries::QBarSeries(QBarCategories categories, QObject *parent) m_mapCategories = -1; m_mapBarBottom = -1; m_mapBarTop = -1; + m_mapFirst = 0; + m_mapCount = 0; m_mapOrientation = Qt::Vertical; } @@ -234,6 +236,8 @@ bool QBarSeries::setModel(QAbstractItemModel* model) m_mapCategories = -1; m_mapBarBottom = -1; m_mapBarTop = -1; + m_mapFirst = 0; + m_mapCount = 0; m_mapOrientation = Qt::Vertical; } @@ -258,17 +262,20 @@ void QBarSeries::setModelMapping(int categories, int bottomBoundry, int topBound m_mapCategories = categories; m_mapBarBottom = bottomBoundry; m_mapBarTop = topBoundry; + m_mapFirst = 1; m_mapOrientation = orientation; // connect the signals if (m_mapOrientation == Qt::Vertical) { + m_mapCount = m_model->rowCount(); connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelUpdated(QModelIndex, QModelIndex))); connect(m_model,SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(modelDataAdded(QModelIndex,int,int))); connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(modelDataRemoved(QModelIndex,int,int))); } else { + m_mapCount = m_model->columnCount(); connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelUpdated(QModelIndex, QModelIndex))); connect(m_model,SIGNAL(columnsInserted(QModelIndex, int, int)), this, SLOT(modelDataAdded(QModelIndex,int,int))); connect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)), this, SLOT(modelDataRemoved(QModelIndex,int,int))); @@ -280,14 +287,14 @@ void QBarSeries::setModelMapping(int categories, int bottomBoundry, int topBound if (m_mapOrientation == Qt::Vertical) { QStringList categories; - for (int k = 0; k < m_model->rowCount(); k++) + for (int k = m_mapFirst; k < m_mapFirst + m_mapCount; k++) categories << m_model->data(m_model->index(k, m_mapCategories), Qt::DisplayRole).toString(); mModel = new BarChartModel(categories, this); for (int i = m_mapBarBottom; i <= m_mapBarTop; i++) { QBarSet* barSet = new QBarSet(QString("Column: %1").arg(i + 1)); - for(int m = 0; m < m_model->rowCount(); m++) + for(int m = m_mapFirst; m < m_mapFirst + m_mapCount; m++) *barSet << m_model->data(m_model->index(m, i), Qt::DisplayRole).toDouble(); addBarSet(barSet); } @@ -295,37 +302,41 @@ void QBarSeries::setModelMapping(int categories, int bottomBoundry, int topBound else { QStringList categories; - for (int k = 0; k < m_model->columnCount(); k++) + for (int k = m_mapFirst; k < m_mapFirst + m_mapCount; k++) categories << m_model->data(m_model->index(m_mapCategories, k), Qt::DisplayRole).toString(); mModel = new BarChartModel(categories, this); for (int i = m_mapBarBottom; i <= m_mapBarTop; i++) { QBarSet* barSet = new QBarSet(QString("Row: %1").arg(i + 1)); - for(int m = 0; m < m_model->columnCount(); m++) + for(int m = m_mapFirst; m < m_mapFirst + m_mapCount; m++) *barSet << m_model->data(m_model->index(i, m), Qt::DisplayRole).toDouble(); addBarSet(barSet); } } } +void QBarSeries::setModelMappingShift(int first, int count) +{ + m_mapFirst = first; + m_mapCount = count; +} + void QBarSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) { Q_UNUSED(bottomRight) if (m_mapOrientation == Qt::Vertical) { - if (topLeft.column() >= m_mapBarBottom && topLeft.column() <= m_mapBarTop) - barsetAt(topLeft.column() - m_mapBarBottom)->setValue(topLeft.row(), m_model->data(topLeft, Qt::DisplayRole).toDouble()); - // else if (topLeft.column() == m_mapCategories) - // slices().at(topLeft.row())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString()); + // model update is relevant to BarSeries if the change was made to the part of the model that was mapped to BarSeries + if (topLeft.column() >= m_mapBarBottom && topLeft.column() <= m_mapBarTop && topLeft.row() >= m_mapFirst && topLeft.row() < m_mapFirst + m_mapCount) + barsetAt(topLeft.column() - m_mapBarBottom)->setValue(topLeft.row() - m_mapFirst, m_model->data(topLeft, Qt::DisplayRole).toDouble()); } else { - if (topLeft.row() >= m_mapBarBottom && topLeft.row() <= m_mapBarTop) - barsetAt(topLeft.row() - m_mapBarBottom)->setValue(topLeft.column(), m_model->data(topLeft, Qt::DisplayRole).toDouble()); - // else if (topLeft.row() == m_mapCategories) - // slices().at(topLeft.column())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString()); + // model update is relevant to BarSeries if the change was made to the part of the model that was mapped to BarSeries + if (topLeft.row() >= m_mapBarBottom && topLeft.row() <= m_mapBarTop && topLeft.column() >= m_mapFirst && topLeft.column() < m_mapFirst + m_mapCount) + barsetAt(topLeft.row() - m_mapBarBottom)->setValue(topLeft.column() - m_mapFirst, m_model->data(topLeft, Qt::DisplayRole).toDouble()); } } @@ -333,18 +344,18 @@ void QBarSeries::modelDataAdded(QModelIndex /*parent*/, int start, int /*end*/) { if (m_mapOrientation == Qt::Vertical) { - insertCategory(start, QString("Row: %1").arg(start + 1)); + insertCategory(start - m_mapFirst, QString("Row: %1").arg(start + 1)); for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++) { - barsetAt(i)->insertValue(start, m_model->data(m_model->index(start, i), Qt::DisplayRole).toDouble()); + barsetAt(i)->insertValue(start - m_mapFirst, m_model->data(m_model->index(start, i), Qt::DisplayRole).toDouble()); } } else { - insertCategory(start, QString("Column: %1").arg(start + 1)); + insertCategory(start - m_mapFirst, QString("Column: %1").arg(start + 1)); for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++) { - barsetAt(i)->insertValue(start, m_model->data(m_model->index(i, start), Qt::DisplayRole).toDouble()); + barsetAt(i)->insertValue(start - m_mapFirst, m_model->data(m_model->index(i, start), Qt::DisplayRole).toDouble()); } } emit restructuredBar(1); @@ -352,10 +363,10 @@ void QBarSeries::modelDataAdded(QModelIndex /*parent*/, int start, int /*end*/) void QBarSeries::modelDataRemoved(QModelIndex /*parent*/, int start, int /*end*/) { - removeCategory(start); + removeCategory(start - m_mapFirst); for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++) { - barsetAt(i)->removeValue(start); + barsetAt(i)->removeValue(start - m_mapFirst); } emit restructuredBar(1); } diff --git a/src/barchart/qbarseries.h b/src/barchart/qbarseries.h index 23e5d96..23d9a3f 100644 --- a/src/barchart/qbarseries.h +++ b/src/barchart/qbarseries.h @@ -35,6 +35,7 @@ public: bool setModel(QAbstractItemModel* model); QAbstractItemModel* modelExt() {return m_model;} void setModelMapping(int categories, int bottomBoundry, int topBoundry, Qt::Orientation orientation = Qt::Vertical); + void setModelMappingShift(int first, int count); public: // TODO: Functions below this are not part of api and will be moved @@ -87,6 +88,8 @@ protected: int m_mapCategories; int m_mapBarBottom; int m_mapBarTop; + int m_mapFirst; + int m_mapCount; Qt::Orientation m_mapOrientation; }; diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp index eb3976d..1b63a46 100644 --- a/src/splinechart/qsplineseries.cpp +++ b/src/splinechart/qsplineseries.cpp @@ -147,6 +147,12 @@ bool QSplineSeries::setModel(QAbstractItemModel* model) void QSplineSeries::setModelMapping(int modelX, int modelY, Qt::Orientation orientation) { QLineSeries::setModelMapping(modelX, modelY, orientation); +// calculateControlPoints(); +} + +void QSplineSeries::setModelMappingShift(int first, int count) +{ + QLineSeries::setModelMappingShift(first, count); calculateControlPoints(); } diff --git a/src/splinechart/qsplineseries.h b/src/splinechart/qsplineseries.h index 1e77099..3e4aec3 100644 --- a/src/splinechart/qsplineseries.h +++ b/src/splinechart/qsplineseries.h @@ -22,6 +22,7 @@ public: bool setModel(QAbstractItemModel* model); void setModelMapping(int modelX, int modelY, Qt::Orientation orientation = Qt::Vertical); + void setModelMappingShift(int first, int count); // TODO: allow the user to set custom control points // void setCustomControlPoints(QList controlPoints); diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index cd07c52..d960877 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -52,6 +52,9 @@ QXYSeries::QXYSeries(QObject* parent):QSeries(parent) { m_mapX = -1; m_mapY = -1; + m_mapFirst = 0; + m_mapCount = 0; + m_mapLimited = false; m_mapOrientation = Qt::Vertical; // m_mapYOrientation = Qt::Vertical; } @@ -171,10 +174,10 @@ qreal QXYSeries::x(int pos) const if (m_model) if (m_mapOrientation == Qt::Vertical) // consecutive data is read from model's column - return m_model->data(m_model->index(pos, m_mapX), Qt::DisplayRole).toDouble(); + return m_model->data(m_model->index(pos + m_mapFirst, m_mapX), Qt::DisplayRole).toDouble(); else // consecutive data is read from model's row - return m_model->data(m_model->index(m_mapX, pos), Qt::DisplayRole).toDouble(); + return m_model->data(m_model->index(m_mapX, pos + m_mapFirst), Qt::DisplayRole).toDouble(); else // model is not specified, return the data from series' internal data store return m_x.at(pos); @@ -188,10 +191,10 @@ qreal QXYSeries::y(int pos) const if (m_model) if (m_mapOrientation == Qt::Vertical) // consecutive data is read from model's column - return m_model->data(m_model->index(pos, m_mapY), Qt::DisplayRole).toDouble(); + return m_model->data(m_model->index(pos + m_mapFirst, m_mapY), Qt::DisplayRole).toDouble(); else // consecutive data is read from model's row - return m_model->data(m_model->index(m_mapY, pos), Qt::DisplayRole).toDouble(); + return m_model->data(m_model->index(m_mapY, pos + m_mapFirst), Qt::DisplayRole).toDouble(); else // model is not specified, return the data from series' internal data store return m_y.at(pos); @@ -206,11 +209,23 @@ int QXYSeries::count() const if (m_model) { if (m_mapOrientation == Qt::Vertical) - // data is in a column, so return the number of items in single column - return m_model->rowCount(); + { + // data is in a column. Return the number of mapped items if the model's column have enough items + // or the number of items that can be mapped + if (m_mapLimited) + return qMin(m_mapCount, qMax(m_model->rowCount() - m_mapFirst, 0)); + else + return qMax(m_model->rowCount() - m_mapFirst, 0); + } else - // data is in a row, so return the number of items in single row - return m_model->columnCount(); + { + // data is in a row. Return the number of mapped items if the model's row have enough items + // or the number of items that can be mapped + if (m_mapLimited) + return qMin(m_mapCount, qMax(m_model->columnCount() - m_mapFirst, 0)); + else + return qMax(m_model->columnCount() - m_mapFirst, 0); + } } // model is not specified, return the number of points in the series internal data store @@ -286,23 +301,148 @@ void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) Q_UNUSED(bottomRight) if (m_mapOrientation == Qt::Vertical) - emit pointReplaced(topLeft.row()); + { + if (topLeft.row() >= m_mapFirst && (!m_mapLimited || topLeft.row() < m_mapFirst + m_mapCount)) + emit pointReplaced(topLeft.row() - m_mapFirst); + } + else + { + if (topLeft.column() >= m_mapFirst && (!m_mapLimited || topLeft.column() < m_mapFirst + m_mapCount)) + emit pointReplaced(topLeft.column() - m_mapFirst); + } +} + +void QXYSeries::modelDataAboutToBeAdded(QModelIndex parent, int start, int end) +{ + Q_UNUSED(parent) + // Q_UNUSED(end) + + if (m_mapLimited) + { + if (start >= m_mapFirst + m_mapCount) + // the added data is below mapped area + // therefore it has no relevance + return; + else + { + // the added data is in the mapped area or before it and update is needed + + // check how many mapped items there is currently (before new items are added) + // if the number of items currently is equal the m_mapCount then some needs to be removed from xychartitem + // internal storage before new ones can be added + if (m_mapCount == count()) + for (int i = 0; i < qMin(count(), end - start + 1); i++) + emit pointRemoved(count() - 1 - i); + } + } else - emit pointReplaced(topLeft.column()); + { + // map is not limited (it includes all the items starting from m_mapFirst till the end of model) + // nothing to do + // emit pointAdded(qMax(start - m_mapFirst, 0)); + } } void QXYSeries::modelDataAdded(QModelIndex parent, int start, int end) { Q_UNUSED(parent) - Q_UNUSED(end) - emit pointAdded(start); + // Q_UNUSED(end) + + if (m_mapLimited) + { + if (start >= m_mapFirst + m_mapCount) + // the added data is below mapped area + // therefore it has no relevance + return; + else + { + // the added data is in the mapped area or before it + // update needed + if (count() > 0) + for (int i = 0; i < qMin(m_mapCount, end - start + 1); i++) + emit pointAdded(qMax(start + i - m_mapFirst, 0)); + } + } + else + { + // map is not limited (it included all the items starting from m_mapFirst till the end of model) + for (int i = 0; i < end - start + 1; i++) + emit pointAdded(qMax(start + i - m_mapFirst, 0)); + } +} + +void QXYSeries::modelDataAboutToBeRemoved(QModelIndex parent, int start, int end) +{ + Q_UNUSED(parent) + // Q_UNUSED(end) + + if (m_mapLimited) + { + if (start >= m_mapFirst + m_mapCount) + // the removed data is below mapped area + // therefore it has no relevance + return; + else + { + // the removed data is in the mapped area or before it + // update needed + int itemsToRemove = qMin(count(), end - start + 1); + tempItemsRemoved = itemsToRemove; + int z = count(); + z = z; + // if (itemsToRemove > 0) + // { + for (int i = 0; i < itemsToRemove; i++) + emit pointRemoved(qMax(start - m_mapFirst, 0)); + } + } + else + { + // map is not limited (it included all the items starting from m_mapFirst till the end of model) + for (int i = 0; i < end - start + 1; i++) + emit pointRemoved(qMax(start - m_mapFirst, 0)); + } } void QXYSeries::modelDataRemoved(QModelIndex parent, int start, int end) { Q_UNUSED(parent) Q_UNUSED(end) - emit pointRemoved(start); + + // how many items there were before data was removed + // int oldCount = count() - 1; + + if (m_mapLimited) + { + if (start >= m_mapFirst + m_mapCount) + // the removed data is below mapped area + // therefore it has no relevance + return; + else + { + // if there are excess items available (below the map) use them to repopulate mapped area + int extraItemsAvailable = 0; + if (m_mapOrientation == Qt::Vertical) + { + extraItemsAvailable = qMax(m_model->rowCount() - m_mapFirst, 0); + } + else + { + extraItemsAvailable = qMax(m_model->columnCount() - m_mapFirst, 0); + } + + // int extraItemsNeeded = qMin(extraItemsAvailable, tempItemsRemoved); + for (int k = 0; k < tempItemsRemoved; k++) + if (start - m_mapFirst + k < extraItemsAvailable) + { + emit pointAdded(count() - m_mapFirst + k); + } + } + } + else + { + // emit pointRemoved(qMax(start - m_mapFirst, 0)); + } } bool QXYSeries::setModel(QAbstractItemModel* model) { @@ -313,6 +453,9 @@ bool QXYSeries::setModel(QAbstractItemModel* model) { disconnect(m_model, 0, this, 0); m_mapX = -1; m_mapY = -1; + m_mapFirst = 0; + m_mapCount = 0; + m_mapLimited = false; m_mapOrientation = Qt::Vertical; } @@ -335,26 +478,39 @@ void QXYSeries::setModelMapping(int modelX, int modelY, Qt::Orientation orientat return; m_mapX = modelX; m_mapY = modelY; + m_mapFirst = 0; m_mapOrientation = orientation; if (m_mapOrientation == Qt::Vertical) { + // m_mapCount = m_model->rowCount(); connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelUpdated(QModelIndex, QModelIndex))); + connect(m_model,SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), this, SLOT(modelDataAboutToBeAdded(QModelIndex,int,int))); connect(m_model,SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(modelDataAdded(QModelIndex,int,int))); + connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(modelDataAboutToBeRemoved(QModelIndex,int,int))); connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(modelDataRemoved(QModelIndex,int,int))); } else { + // m_mapCount = m_model->columnCount(); connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelUpdated(QModelIndex, QModelIndex))); + connect(m_model,SIGNAL(columnsAboutToBeInserted(QModelIndex, int, int)), this, SLOT(modelDataAboutToBeAdded(QModelIndex,int,int))); connect(m_model,SIGNAL(columnsInserted(QModelIndex, int, int)), this, SLOT(modelDataAdded(QModelIndex,int,int))); + connect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(modelDataAboutToBeRemoved(QModelIndex,int,int))); connect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)), this, SLOT(modelDataRemoved(QModelIndex,int,int))); } } -//void QXYSeries::setModelMappingY(int modelLineIndex, Qt::Orientation orientation) -//{ -// m_mapY = modelLineIndex; -// m_mapYOrientation = orientation; -//} +void QXYSeries::setModelMappingShift(int first, int count) +{ + m_mapFirst = first; + if (count == 0) + m_mapLimited = false; + else + { + m_mapCount = count; + m_mapLimited = true; + } +} #include "moc_qxyseries.cpp" diff --git a/src/xychart/qxyseries.h b/src/xychart/qxyseries.h index fdc0d0f..77c9671 100644 --- a/src/xychart/qxyseries.h +++ b/src/xychart/qxyseries.h @@ -44,11 +44,13 @@ public: QAbstractItemModel* model() {return m_model;} virtual void setModelMapping(int modelX, int modelY, Qt::Orientation orientation = Qt::Vertical); -// void setModelMappingY(int modelLineIndex, Qt::Orientation orientation = Qt::Vertical); + virtual void setModelMappingShift(int first, int count = 0); private slots: void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); + void modelDataAboutToBeAdded(QModelIndex parent, int start, int end); void modelDataAdded(QModelIndex parent, int start, int end); + void modelDataAboutToBeRemoved(QModelIndex parent, int start, int end); void modelDataRemoved(QModelIndex parent, int start, int end); signals: @@ -65,11 +67,13 @@ protected: QPen m_pen; QBrush m_brush; -// QAbstractItemModel* m_model; - int m_mapX; - Qt::Orientation m_mapOrientation; + int m_mapX; int m_mapY; -// Qt::Orientation m_mapYOrientation; + int m_mapFirst; + int m_mapCount; + bool m_mapLimited; + Qt::Orientation m_mapOrientation; + int tempItemsRemoved; }; QTCOMMERCIALCHART_END_NAMESPACE