Fix sorting of vendors list in add thing dialog
This commit is contained in:
parent
31b05c81a6
commit
283f99d94a
@ -27,6 +27,7 @@
|
||||
VendorsProxy::VendorsProxy(QObject *parent) : QSortFilterProxyModel(parent)
|
||||
{
|
||||
setSortRole(Vendors::RoleDisplayName);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
Vendors *VendorsProxy::vendors()
|
||||
@ -50,11 +51,4 @@ Vendor *VendorsProxy::get(int index) const
|
||||
return m_vendors->get(mapToSource(this->index(index, 0)).row());
|
||||
}
|
||||
|
||||
bool VendorsProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
QVariant leftName = sourceModel()->data(left);
|
||||
QVariant rightName = sourceModel()->data(right);
|
||||
|
||||
return QString::localeAwareCompare(leftName.toString(), rightName.toString()) < 0;
|
||||
}
|
||||
|
||||
|
||||
@ -49,12 +49,6 @@ signals:
|
||||
private:
|
||||
Vendors *m_vendors;
|
||||
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
};
|
||||
|
||||
#endif // VENDORSPROXY_H
|
||||
|
||||
Reference in New Issue
Block a user