blob: a727c964cff674585b5a41f1f3d55ccb502f12ea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#ifndef FILTERWIDGET_2_H
#define FILTERWIDGET_2_H
#include <QHideEvent>
#include <QShowEvent>
#include <vector>
#include <memory>
#include "ui_filterwidget2.h"
#include "core/divefilter.h"
#include "qt-models/filterconstraintmodel.h"
class FilterConstraintWidget;
class QMenu;
class FilterWidget2 : public QWidget {
Q_OBJECT
public:
explicit FilterWidget2(QWidget *parent = 0);
~FilterWidget2();
QString shownText();
protected:
void hideEvent(QHideEvent *event) override;
void showEvent(QShowEvent *event) override;
private slots:
void clearFilter();
void closeFilter();
void updateFilter();
void constraintAdded(const QModelIndex &parent, int first, int last);
void constraintRemoved(const QModelIndex &parent, int first, int last);
void constraintChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
void constraintsReset();
void updatePresetMenu();
void presetClicked(const QModelIndex &index);
void presetSelected(const QItemSelection &selected, const QItemSelection &);
void on_addSetButton_clicked();
private:
bool ignoreSignal;
Ui::FilterWidget2 ui;
FilterConstraintModel constraintModel;
bool validFilter;
void addConstraint(filter_constraint_type type);
std::vector<std::unique_ptr<FilterConstraintWidget>> constraintWidgets;
FilterData createFilterData() const;
void setFilterData(const FilterData &filterData);
void loadPreset(int index);
void selectPreset(int i);
void clearFilterData();
std::unique_ptr<QMenu> loadFilterPresetMenu;
};
#endif
|