mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Fixed selection of view rows when changing to filtered data
* return values for select functions * select function must be "public override" * reselect filtered data as well
This commit is contained in:
committed by
Mat Sutcliffe
parent
88e82404e2
commit
30b65d6c36
@@ -176,9 +176,10 @@ namespace BlackGui
|
||||
|
||||
this->beginResetModel();
|
||||
m_container = performSort ? sortedContainer : container;
|
||||
this->updateFilteredContainer();
|
||||
this->updateFilteredContainer(); // use sorted container for filtered if applicable
|
||||
this->endResetModel();
|
||||
|
||||
// reselect if implemented in specialized view
|
||||
if (!selection.isEmpty())
|
||||
{
|
||||
m_selectionModel->selectObjects(selection);
|
||||
@@ -265,6 +266,12 @@ namespace BlackGui
|
||||
template <typename T, bool UseCompare>
|
||||
void CListModelBase<T, UseCompare>::takeFilterOwnership(std::unique_ptr<IModelFilter<ContainerType> > &filter)
|
||||
{
|
||||
ContainerType selection;
|
||||
if (m_selectionModel)
|
||||
{
|
||||
selection = m_selectionModel->selectedObjects();
|
||||
}
|
||||
|
||||
if (!filter)
|
||||
{
|
||||
this->removeFilter(); // clear filter
|
||||
@@ -283,6 +290,12 @@ namespace BlackGui
|
||||
// invalid filter, so clear filter
|
||||
this->removeFilter();
|
||||
}
|
||||
|
||||
// reselect if implemented in specialized views
|
||||
if (!selection.isEmpty())
|
||||
{
|
||||
m_selectionModel->selectObjects(selection);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, bool UseCompare>
|
||||
|
||||
Reference in New Issue
Block a user