mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
The UI talks to the filter model. Therefore route clearing of data through that model instead of accessing the source model directly. This will allow us to remove the DiveTripModel::instance() function and makes control flow less "jumpy". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
28 lines
803 B
C++
28 lines
803 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef FILTERMODELS_H
|
|
#define FILTERMODELS_H
|
|
|
|
#include "divetripmodel.h"
|
|
|
|
#include <QSortFilterProxyModel>
|
|
|
|
class MultiFilterSortModel : public QSortFilterProxyModel {
|
|
Q_OBJECT
|
|
public:
|
|
static MultiFilterSortModel *instance();
|
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
|
bool lessThan(const QModelIndex &, const QModelIndex &) const override;
|
|
|
|
void resetModel(DiveTripModelBase::Layout layout);
|
|
void clear();
|
|
signals:
|
|
void selectionChanged(const QVector<QModelIndex> &indexes);
|
|
void currentDiveChanged(QModelIndex index);
|
|
private slots:
|
|
void selectionChangedSlot(const QVector<QModelIndex> &indexes);
|
|
void currentDiveChangedSlot(QModelIndex index);
|
|
private:
|
|
MultiFilterSortModel(QObject *parent = 0);
|
|
};
|
|
|
|
#endif
|