Add type roles to the model sorting capabilities.
This commit is contained in:
@ -59,6 +59,12 @@ bool GeneralSortFilterModel::lessThan(const QModelIndex& source_left,
|
||||
const QString rightString = rightData.toString();
|
||||
return m_collator.compare(leftString, rightString) > 0;
|
||||
}
|
||||
const bool isType = TYPE_ROLES.contains(role);
|
||||
if (isType) {
|
||||
const QString leftString = leftData.toString();
|
||||
const QString rightString = rightData.toString();
|
||||
return m_collator.compare(leftString, rightString) > 0;
|
||||
}
|
||||
const bool isInt = INT_ROLES.contains(role);
|
||||
if (isInt) {
|
||||
const int leftInt = leftData.toInt();
|
||||
|
||||
Reference in New Issue
Block a user