mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #655, Change signature (order) of setProperty/compareProperty
This commit is contained in:
committed by
Roland Winklmeier
parent
49094115b1
commit
0f5d2a29a8
@@ -282,7 +282,7 @@ namespace BlackGui
|
||||
ObjectType obj = this->m_container[index.row()];
|
||||
ObjectType currentObject(obj);
|
||||
BlackMisc::CPropertyIndex propertyIndex = this->columnToPropertyIndex(index.column());
|
||||
obj.setPropertyByIndex(value, propertyIndex);
|
||||
obj.setPropertyByIndex(propertyIndex, value);
|
||||
|
||||
if (obj != currentObject)
|
||||
{
|
||||
|
||||
@@ -298,7 +298,7 @@ namespace BlackGui
|
||||
template<class ObjectType>
|
||||
bool compareForModelSort(const ObjectType &a, const ObjectType &b, Qt::SortOrder order, const BlackMisc::CPropertyIndex &index, std::true_type)
|
||||
{
|
||||
int c = a.comparePropertyByIndex(b, index);
|
||||
int c = a.comparePropertyByIndex(index, b);
|
||||
if (c == 0) { return false; }
|
||||
return (order == Qt::AscendingOrder) ? (c < 0) : (c > 0);
|
||||
}
|
||||
|
||||
@@ -786,10 +786,10 @@ namespace BlackGui
|
||||
if (!hasSelection()) { return 0; }
|
||||
int c = 0;
|
||||
|
||||
QModelIndexList indexes = this->selectedRows();
|
||||
int lastUpdatedRow = -1;
|
||||
int firstUpdatedRow = -1;
|
||||
const CPropertyIndexList pis(vm.indexes());
|
||||
const CPropertyIndexList propertyIndexes(vm.indexes());
|
||||
const QModelIndexList indexes = this->selectedRows();
|
||||
|
||||
for (const QModelIndex &i : indexes)
|
||||
{
|
||||
@@ -799,9 +799,9 @@ namespace BlackGui
|
||||
ObjectType obj(this->at(i));
|
||||
|
||||
// update all properties in map
|
||||
for (const CPropertyIndex &pi : pis)
|
||||
for (const CPropertyIndex &pi : propertyIndexes)
|
||||
{
|
||||
obj.setPropertyByIndex(vm.value(pi), pi);
|
||||
obj.setPropertyByIndex(pi, vm.value(pi));
|
||||
}
|
||||
|
||||
// and update container
|
||||
|
||||
Reference in New Issue
Block a user