Fix selection issue when expanding a tree

The selection anchor must be reset when changing the current item
to the root of the tree.

BUG: 290832
FIXED-IN: 4.8.0
This commit is contained in:
Peter Penz 2012-01-11 22:33:20 +01:00
parent 21a52d42e9
commit 2f42a397e0
2 changed files with 3 additions and 1 deletions

View file

@ -380,7 +380,9 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const
}
if (m_view->isAboveExpansionToggle(m_pressedIndex, m_pressedMousePos)) {
m_selectionManager->endAnchoredSelection();
m_selectionManager->setCurrentItem(m_pressedIndex);
m_selectionManager->beginAnchoredSelection(m_pressedIndex);
return true;
}

View file

@ -92,7 +92,7 @@ private:
KItemModelBase* m_model;
friend class KItemListController; // Calls setModel()
friend class KItemListView; // Calls itemsInserted() and itemsRemoved()
friend class KItemListView; // Calls itemsInserted(), itemsRemoved() and itemsMoved()
friend class KItemListSelectionManagerTest;
};