mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added the skeleton for the BuddyFilter
Just the skeleton of the functions, nothing working yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
318256cfb4
commit
2c924b6834
2 changed files with 55 additions and 0 deletions
|
@ -2351,6 +2351,42 @@ bool TagFilterModel::filterRow(int source_row, const QModelIndex &source_parent,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuddyFilterModel::BuddyFilterModel(QObject *parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BuddyFilterModel *BuddyFilterModel::instance()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags BuddyFilterModel::flags(const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
return QStringListModel::flags(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BuddyFilterModel::repopulate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant BuddyFilterModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
return QStringListModel::data(index, role);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool BuddyFilterModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||||
|
{
|
||||||
|
return QStringListModel::setData(index, value, role);
|
||||||
|
}
|
||||||
|
|
||||||
MultiFilterSortModel *MultiFilterSortModel::instance()
|
MultiFilterSortModel *MultiFilterSortModel::instance()
|
||||||
{
|
{
|
||||||
static MultiFilterSortModel *self = new MultiFilterSortModel();
|
static MultiFilterSortModel *self = new MultiFilterSortModel();
|
||||||
|
|
|
@ -443,6 +443,25 @@ private:
|
||||||
explicit TagFilterModel(QObject *parent = 0);
|
explicit TagFilterModel(QObject *parent = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class BuddyFilterModel : public QStringListModel, public MultiFilterInterface{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static BuddyFilterModel *instance();
|
||||||
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
|
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||||
|
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
|
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||||
|
bool *checkState;
|
||||||
|
bool anyChecked;
|
||||||
|
public
|
||||||
|
slots:
|
||||||
|
void repopulate();
|
||||||
|
|
||||||
|
private:
|
||||||
|
explicit BuddyFilterModel(QObject *parent = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class MultiFilterSortModel : public QSortFilterProxyModel {
|
class MultiFilterSortModel : public QSortFilterProxyModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Reference in a new issue