##// END OF EJS Templates
QPieSeries: label value is now also updated when the same row/column of the model is mapped for values and labels
Marek Rosa -
r638:61d3ed85e2c1
parent child
Show More
@@ -541,7 +541,15 void QPieSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight)
541 541 {
542 542 // slices().at(topLeft.row())->setValue(m_model->data(m_model->index(topLeft.row(), topLeft.column()), Qt::DisplayRole).toDouble());
543 543 if (topLeft.column() == m_mapValues)
544 if (m_mapValues == m_mapLabels)
545 {
544 546 slices().at(topLeft.row())->setValue(m_model->data(topLeft, Qt::DisplayRole).toDouble());
547 slices().at(topLeft.row())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString());
548 }
549 else
550 {
551 slices().at(topLeft.row())->setValue(m_model->data(topLeft, Qt::DisplayRole).toDouble());
552 }
545 553 else if (topLeft.column() == m_mapLabels)
546 554 slices().at(topLeft.row())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString());
547 555 }
@@ -549,7 +557,15 void QPieSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight)
549 557 {
550 558 // slices().at(topLeft.column())->setValue(m_model->data(m_model->index(topLeft.row(), topLeft.column()), Qt::DisplayRole).toDouble());
551 559 if (topLeft.row() == m_mapValues)
560 if (m_mapValues == m_mapLabels)
561 {
552 562 slices().at(topLeft.column())->setValue(m_model->data(topLeft, Qt::DisplayRole).toDouble());
563 slices().at(topLeft.column())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString());
564 }
565 else
566 {
567 slices().at(topLeft.column())->setValue(m_model->data(topLeft, Qt::DisplayRole).toDouble());
568 }
553 569 else if (topLeft.row() == m_mapLabels)
554 570 slices().at(topLeft.column())->setLabel(m_model->data(topLeft, Qt::DisplayRole).toString());
555 571 }
General Comments 0
You need to be logged in to leave comments. Login now