diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/main-view/CardFilterModel.cpp |
Diffstat (limited to 'src/main-view/CardFilterModel.cpp')
-rw-r--r-- | src/main-view/CardFilterModel.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main-view/CardFilterModel.cpp b/src/main-view/CardFilterModel.cpp new file mode 100644 index 0000000..50ac75d --- /dev/null +++ b/src/main-view/CardFilterModel.cpp @@ -0,0 +1,24 @@ +#include "CardFilterModel.h" + +CardFilterModel::CardFilterModel( QObject* parent ): + QSortFilterProxyModel( parent ) + { + } + +void CardFilterModel::addFilterRow( int aRow ) + { + if( m_filterRows.contains( aRow ) ) + return; + m_filterRows << aRow; + } + +void CardFilterModel::removeFilterRow( int aRow ) + { + m_filterRows.removeOne( aRow ); + } + +bool CardFilterModel::filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const + { + Q_UNUSED( source_parent ); + return m_filterRows.contains( source_row ); + } |