mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #785, use selection interface with views
* adjusted sortByPropertyIndex, selectObjects * function to select by row numbers
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a374146a41
commit
97137c46a6
@@ -59,15 +59,17 @@ namespace BlackGui
|
||||
if (keys.isEmpty()) { return; }
|
||||
this->clearSelection();
|
||||
int r = -1;
|
||||
QSet<int> rows;
|
||||
for (const ObjectType &obj : CViewBase<ModelClass, ContainerType, ObjectType>::containerOrFilteredContainer())
|
||||
{
|
||||
r++;
|
||||
if (!obj.hasValidDbKey()) { continue; }
|
||||
if (keys.contains(obj.getDbKey()))
|
||||
{
|
||||
this->selectRow(r);
|
||||
rows.insert(r);
|
||||
}
|
||||
}
|
||||
this->selectRows(rows);
|
||||
}
|
||||
|
||||
template <class ModelClass, class ContainerType, class ObjectType, class KeyType>
|
||||
@@ -164,7 +166,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
template <class ModelClass, class ContainerType, class ObjectType, class KeyType>
|
||||
void COrderableViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::reselect(const ContainerType &selectedObjects)
|
||||
void COrderableViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::selectObjects(const ContainerType &selectedObjects)
|
||||
{
|
||||
if (!selectedObjects.isEmpty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user