Search in "Manage sets" window (#3229)

* search field added; sortfilterproxy displayed in treeview

* searching works properly

* moving with filter on works; view isnt't updated yet

* clangify & view updating figured out

* moving disabled when sorting is active

* drag&drop disabled when view sorted

* clangified

* foreach replaced

* button rename & SORT_RESET defined

* changed variable names

* 'x' button added & searchlabel text modified

* 'enabled' column won't grow anymore

* column resize improvement

* button hint & restore original order added

* moving with filter on works; view isnt't updated yet

* sort disable build in column headers (3 clicks)

* codacy fix

* typo + wording

* background color for warning

* buttons moved down a bit

* clicking "default order" button will hide the warning text
This commit is contained in:
David Szabo 2018-06-10 17:00:42 +02:00 committed by Zach H
parent 91b3c7343d
commit 81803e2612
4 changed files with 183 additions and 29 deletions

View file

@ -5,6 +5,7 @@
#include <QAbstractTableModel>
#include <QMimeData>
#include <QSet>
#include <QSortFilterProxyModel>
class SetsProxyModel;
@ -80,4 +81,16 @@ public:
void restore(CardDatabase *db);
};
class SetsDisplayModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
SetsDisplayModel(QObject *parent = NULL);
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
void fetchMore(const QModelIndex &index) override;
};
#endif