diff options
author | Arno <arno@disconnect.de> | 2018-02-17 19:29:41 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-02-17 19:29:41 +0100 |
commit | 280c75090cb518f0f1a4e2b470a7722f95b9c9ab (patch) | |
tree | 466cb4a6ea3dedb02a944fa9378fa5fa0355a206 /collectionwidgetproxy.h | |
parent | b49d5333119239cf32f873d25a3d46d788f9747e (diff) | |
download | BeetPlayer-280c75090cb518f0f1a4e2b470a7722f95b9c9ab.tar.gz BeetPlayer-280c75090cb518f0f1a4e2b470a7722f95b9c9ab.tar.bz2 BeetPlayer-280c75090cb518f0f1a4e2b470a7722f95b9c9ab.zip |
Make filtering useful
Add a custom QSortFilterProxyModel which filterAcceptsRow() returns true
if the uppermost parent matches the filter RegExp.
Diffstat (limited to 'collectionwidgetproxy.h')
-rw-r--r-- | collectionwidgetproxy.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/collectionwidgetproxy.h b/collectionwidgetproxy.h new file mode 100644 index 0000000..d67f615 --- /dev/null +++ b/collectionwidgetproxy.h @@ -0,0 +1,14 @@ +#ifndef COLLECTIONWIDGETPROXY_H +#define COLLECTIONWIDGETPROXY_H + +#include <QSortFilterProxyModel> + +class CollectionWidgetProxy : public QSortFilterProxyModel { + public: + CollectionWidgetProxy(QObject *parent = nullptr); + + protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; +}; + +#endif // COLLECTIONWIDGETPROXY_H |