Fixes in model set form as described by RP

https://swift-project.slack.com/archives/G96QTUBEG/p1544353355002400

* fixed missing radio button groups
* return values for some functions to detect "changes"
* minor style fixes
This commit is contained in:
Klaus Basan
2018-12-10 01:35:04 +01:00
parent 9b06a159f2
commit 9f408e8319
9 changed files with 176 additions and 115 deletions

View File

@@ -97,15 +97,20 @@ namespace BlackGui
this->sort(column, order);
}
void CListModelBaseNonTemplate::setSortColumnByPropertyIndex(const CPropertyIndex &propertyIndex)
bool CListModelBaseNonTemplate::setSortColumnByPropertyIndex(const CPropertyIndex &propertyIndex)
{
m_sortColumn = m_columns.propertyIndexToColumn(propertyIndex);
const int column = m_columns.propertyIndexToColumn(propertyIndex);
if (m_sortColumn == column) { return false; } // not changed
m_sortColumn = column;
return true; // changed
}
void CListModelBaseNonTemplate::setSorting(const CPropertyIndex &propertyIndex, Qt::SortOrder order)
bool CListModelBaseNonTemplate::setSorting(const CPropertyIndex &propertyIndex, Qt::SortOrder order)
{
this->setSortColumnByPropertyIndex(propertyIndex);
const bool changedColumn = this->setSortColumnByPropertyIndex(propertyIndex);
const bool changedOrder = (m_sortOrder == order);
m_sortOrder = order;
return changedColumn || changedOrder;
}
bool CListModelBaseNonTemplate::hasValidSortColumn() const