From dcb83cfdc0e6c8e92df0ca2aacfd34c0ca276e2e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 2 May 2014 13:02:57 +0300 Subject: Optimize single item changes in bar/surface item models. We are only able to optimize this in cases where rows and columns of the model are directly mapped to rows and columns of the data proxy. In other cases we do not know if the new values of the changed data item in the model actually specify the same row/column in our data proxy as the previous values. Task-number: QTRD-2190 Change-Id: Ie014469ac894474900e5cfd6d91fd1a60353b1f7 Reviewed-by: Titta Heikkala --- src/datavisualization/engine/bars3dcontroller.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/datavisualization/engine/bars3dcontroller.cpp') diff --git a/src/datavisualization/engine/bars3dcontroller.cpp b/src/datavisualization/engine/bars3dcontroller.cpp index 99fa8223..35b24218 100644 --- a/src/datavisualization/engine/bars3dcontroller.cpp +++ b/src/datavisualization/engine/bars3dcontroller.cpp @@ -148,7 +148,6 @@ void Bars3DController::handleRowsChanged(int startIndex, int count) if (!oldChangeCount) m_changedRows.reserve(count); - int selectedRow = m_selectedBar.x(); for (int i = 0; i < count; i++) { bool newItem = true; int candidate = startIndex + i; @@ -162,7 +161,7 @@ void Bars3DController::handleRowsChanged(int startIndex, int count) if (newItem) { ChangeRow newChangeItem = {series, candidate}; m_changedRows.append(newChangeItem); - if (series == m_selectedBarSeries && selectedRow == candidate) + if (series == m_selectedBarSeries && m_selectedBar.x() == candidate) series->d_ptr->markItemLabelDirty(); } } @@ -516,7 +515,8 @@ void Bars3DController::setSelectedBar(const QPoint &position, QBar3DSeries *seri adjustSelectionPosition(pos, series); if (selectionMode().testFlag(QAbstract3DGraph::SelectionSlice)) { - // If the selected bar is outside data window, or there is no visible selected bar, disable slicing + // If the selected bar is outside data window, or there is no visible selected bar, + // disable slicing. if (pos.x() < m_axisZ->min() || pos.x() > m_axisZ->max() || pos.y() < m_axisX->min() || pos.y() > m_axisX->max() || !series->isVisible()) { -- cgit v1.2.3