SortFilterModel: Do not sort by default
It seems QML sets properties to their default value at startup and thus calls setSortRole(QString()), which causes SortFilterModel to sort by default. CCMAIL: mart@kde.org
This commit is contained in:
parent
01b7135299
commit
5c1e49fa76
@ -103,9 +103,16 @@ QString SortFilterModel::filterRole() const
|
||||
|
||||
void SortFilterModel::setSortRole(const QString &role)
|
||||
{
|
||||
QSortFilterProxyModel::setSortRole(roleNameToId(role));
|
||||
if (m_sortRole == role) {
|
||||
return;
|
||||
}
|
||||
m_sortRole = role;
|
||||
sort(0, sortOrder());
|
||||
if (role.isEmpty()) {
|
||||
sort(-1, Qt::AscendingOrder);
|
||||
} else {
|
||||
QSortFilterProxyModel::setSortRole(roleNameToId(role));
|
||||
sort(0, sortOrder());
|
||||
}
|
||||
}
|
||||
|
||||
QString SortFilterModel::sortRole() const
|
||||
|
Loading…
Reference in New Issue
Block a user