@@ -222,10 +222,7 QBarSet *QBarModelMapperPrivate::barSet(QModelIndex index) | |||||
222 |
|
222 | |||
223 | if (m_orientation == Qt::Vertical && index.column() >= m_firstBarSetSection && index.column() <= m_lastBarSetSection) { |
|
223 | if (m_orientation == Qt::Vertical && index.column() >= m_firstBarSetSection && index.column() <= m_lastBarSetSection) { | |
224 | if (index.row() >= m_first && (m_count == - 1 || index.row() < m_first + m_count)) { |
|
224 | if (index.row() >= m_first && (m_count == - 1 || index.row() < m_first + m_count)) { | |
225 | // if (m_model->index(index.row(), m_valuesSection).isValid() && m_model->index(index.row(), m_labelsSection).isValid()) |
|
|||
226 | return m_series->barSets().at(index.column() - m_firstBarSetSection); |
|
225 | return m_series->barSets().at(index.column() - m_firstBarSetSection); | |
227 | // else |
|
|||
228 | // return 0; |
|
|||
229 | } |
|
226 | } | |
230 | } else if (m_orientation == Qt::Horizontal && index.row() >= m_firstBarSetSection && index.row() <= m_lastBarSetSection) { |
|
227 | } else if (m_orientation == Qt::Horizontal && index.row() >= m_firstBarSetSection && index.row() <= m_lastBarSetSection) { | |
231 | if (index.column() >= m_first && (m_count == - 1 || index.column() < m_first + m_count)) |
|
228 | if (index.column() >= m_first && (m_count == - 1 || index.column() < m_first + m_count)) | |
@@ -304,15 +301,13 void QBarModelMapperPrivate::modelHeaderDataUpdated(Qt::Orientation orientation, | |||||
304 |
|
301 | |||
305 | void QBarModelMapperPrivate::modelRowsAdded(QModelIndex parent, int start, int end) |
|
302 | void QBarModelMapperPrivate::modelRowsAdded(QModelIndex parent, int start, int end) | |
306 | { |
|
303 | { | |
307 |
Q_UNUSED(parent) |
|
304 | Q_UNUSED(parent) | |
308 | Q_UNUSED(end) |
|
|||
309 | if (m_modelSignalsBlock) |
|
305 | if (m_modelSignalsBlock) | |
310 | return; |
|
306 | return; | |
311 |
|
307 | |||
312 | blockSeriesSignals(); |
|
308 | blockSeriesSignals(); | |
313 | if (m_orientation == Qt::Vertical) |
|
309 | if (m_orientation == Qt::Vertical) | |
314 |
|
|
310 | insertData(start, end); | |
315 | initializeBarFromModel(); |
|
|||
316 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize |
|
311 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize | |
317 | initializeBarFromModel(); |
|
312 | initializeBarFromModel(); | |
318 | blockSeriesSignals(false); |
|
313 | blockSeriesSignals(false); | |
@@ -320,15 +315,13 void QBarModelMapperPrivate::modelRowsAdded(QModelIndex parent, int start, int e | |||||
320 |
|
315 | |||
321 | void QBarModelMapperPrivate::modelRowsRemoved(QModelIndex parent, int start, int end) |
|
316 | void QBarModelMapperPrivate::modelRowsRemoved(QModelIndex parent, int start, int end) | |
322 | { |
|
317 | { | |
323 |
Q_UNUSED(parent) |
|
318 | Q_UNUSED(parent) | |
324 | Q_UNUSED(end) |
|
|||
325 | if (m_modelSignalsBlock) |
|
319 | if (m_modelSignalsBlock) | |
326 | return; |
|
320 | return; | |
327 |
|
321 | |||
328 | blockSeriesSignals(); |
|
322 | blockSeriesSignals(); | |
329 | if (m_orientation == Qt::Vertical) |
|
323 | if (m_orientation == Qt::Vertical) | |
330 |
|
|
324 | removeData(start, end); | |
331 | initializeBarFromModel(); |
|
|||
332 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize |
|
325 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize | |
333 | initializeBarFromModel(); |
|
326 | initializeBarFromModel(); | |
334 | blockSeriesSignals(false); |
|
327 | blockSeriesSignals(false); | |
@@ -336,15 +329,13 void QBarModelMapperPrivate::modelRowsRemoved(QModelIndex parent, int start, int | |||||
336 |
|
329 | |||
337 | void QBarModelMapperPrivate::modelColumnsAdded(QModelIndex parent, int start, int end) |
|
330 | void QBarModelMapperPrivate::modelColumnsAdded(QModelIndex parent, int start, int end) | |
338 | { |
|
331 | { | |
339 |
Q_UNUSED(parent) |
|
332 | Q_UNUSED(parent) | |
340 | Q_UNUSED(end) |
|
|||
341 | if (m_modelSignalsBlock) |
|
333 | if (m_modelSignalsBlock) | |
342 | return; |
|
334 | return; | |
343 |
|
335 | |||
344 | blockSeriesSignals(); |
|
336 | blockSeriesSignals(); | |
345 | if (m_orientation == Qt::Horizontal) |
|
337 | if (m_orientation == Qt::Horizontal) | |
346 |
|
|
338 | insertData(start, end); | |
347 | initializeBarFromModel(); |
|
|||
348 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize |
|
339 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize | |
349 | initializeBarFromModel(); |
|
340 | initializeBarFromModel(); | |
350 | blockSeriesSignals(false); |
|
341 | blockSeriesSignals(false); | |
@@ -352,15 +343,13 void QBarModelMapperPrivate::modelColumnsAdded(QModelIndex parent, int start, in | |||||
352 |
|
343 | |||
353 | void QBarModelMapperPrivate::modelColumnsRemoved(QModelIndex parent, int start, int end) |
|
344 | void QBarModelMapperPrivate::modelColumnsRemoved(QModelIndex parent, int start, int end) | |
354 | { |
|
345 | { | |
355 |
Q_UNUSED(parent) |
|
346 | Q_UNUSED(parent) | |
356 | Q_UNUSED(end) |
|
|||
357 | if (m_modelSignalsBlock) |
|
347 | if (m_modelSignalsBlock) | |
358 | return; |
|
348 | return; | |
359 |
|
349 | |||
360 | blockSeriesSignals(); |
|
350 | blockSeriesSignals(); | |
361 | if (m_orientation == Qt::Horizontal) |
|
351 | if (m_orientation == Qt::Horizontal) | |
362 |
|
|
352 | removeData(start, end); | |
363 | initializeBarFromModel(); |
|
|||
364 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize |
|
353 | else if (start <= m_firstBarSetSection || start <= m_lastBarSetSection) // if the changes affect the map - reinitialize | |
365 | initializeBarFromModel(); |
|
354 | initializeBarFromModel(); | |
366 | blockSeriesSignals(false); |
|
355 | blockSeriesSignals(false); | |
@@ -376,7 +365,9 void QBarModelMapperPrivate::insertData(int start, int end) | |||||
376 | Q_UNUSED(end) |
|
365 | Q_UNUSED(end) | |
377 | Q_UNUSED(start) |
|
366 | Q_UNUSED(start) | |
378 | Q_UNUSED(end) |
|
367 | Q_UNUSED(end) | |
379 | // To be implemented |
|
368 | // Currently barchart needs to be fully recalculated when change is made. | |
|
369 | // Re-initialize | |||
|
370 | initializeBarFromModel(); | |||
380 | } |
|
371 | } | |
381 |
|
372 | |||
382 | void QBarModelMapperPrivate::removeData(int start, int end) |
|
373 | void QBarModelMapperPrivate::removeData(int start, int end) | |
@@ -384,7 +375,9 void QBarModelMapperPrivate::removeData(int start, int end) | |||||
384 | Q_UNUSED(end) |
|
375 | Q_UNUSED(end) | |
385 | Q_UNUSED(start) |
|
376 | Q_UNUSED(start) | |
386 | Q_UNUSED(end) |
|
377 | Q_UNUSED(end) | |
387 | // To be implemented |
|
378 | // Currently barchart needs to be fully recalculated when change is made. | |
|
379 | // Re-initialize | |||
|
380 | initializeBarFromModel(); | |||
388 | } |
|
381 | } | |
389 |
|
382 | |||
390 | void QBarModelMapperPrivate::barSetsAdded(QList<QBarSet *> sets) |
|
383 | void QBarModelMapperPrivate::barSetsAdded(QList<QBarSet *> sets) |
General Comments 0
You need to be logged in to leave comments.
Login now