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