CInstancesProxyModel: Make use of override

This commit is contained in:
Lioncash 2020-07-03 12:53:41 -04:00
parent c3b724a94b
commit e86c396a6d

View File

@ -6,13 +6,13 @@
class CInstancesProxyModel : public QSortFilterProxyModel class CInstancesProxyModel : public QSortFilterProxyModel
{ {
public: public:
CInstancesProxyModel(QObject *pParent = 0) explicit CInstancesProxyModel(QObject *pParent = nullptr)
: QSortFilterProxyModel(pParent) : QSortFilterProxyModel(pParent)
{ {
setSortCaseSensitivity(Qt::CaseInsensitive); setSortCaseSensitivity(Qt::CaseInsensitive);
} }
virtual bool lessThan(const QModelIndex& rkLeft, const QModelIndex& rkRight) const bool lessThan(const QModelIndex& rkLeft, const QModelIndex& rkRight) const override
{ {
// Don't sort from the top two levels and don't sort the Show column // Don't sort from the top two levels and don't sort the Show column
if (rkLeft.parent() == QModelIndex() || rkLeft.parent().parent() == QModelIndex() || rkLeft.column() == 2) if (rkLeft.parent() == QModelIndex() || rkLeft.parent().parent() == QModelIndex() || rkLeft.column() == 2)
@ -22,7 +22,6 @@ public:
else else
return rkLeft.row() > rkRight.row(); return rkLeft.row() > rkRight.row();
} }
else else
{ {
QString Left = sourceModel()->data(rkLeft).toString(); QString Left = sourceModel()->data(rkLeft).toString();