mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 02:33:23 +00:00
Location Filter, skeleton code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
03c22c3b18
commit
2f60b73bb1
2 changed files with 53 additions and 0 deletions
|
@ -2465,6 +2465,41 @@ bool BuddyFilterModel::setData(const QModelIndex &index, const QVariant &value,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocationFilterModel::LocationFilterModel(QObject *parent): QStringListModel(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant LocationFilterModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
return QStringListModel::data(index, role);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LocationFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags LocationFilterModel::flags(const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
return QStringListModel::flags(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationFilterModel *LocationFilterModel::instance()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocationFilterModel::repopulate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LocationFilterModel::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();
|
||||||
|
|
|
@ -461,6 +461,24 @@ private:
|
||||||
explicit BuddyFilterModel(QObject *parent = 0);
|
explicit BuddyFilterModel(QObject *parent = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LocationFilterModel : public QStringListModel, public MultiFilterInterface{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static LocationFilterModel *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 LocationFilterModel(QObject *parent = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class MultiFilterSortModel : public QSortFilterProxyModel {
|
class MultiFilterSortModel : public QSortFilterProxyModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
Loading…
Add table
Reference in a new issue