aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/filter_dialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/filter_dialog.h')
-rw-r--r--ui/qt/filter_dialog.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/ui/qt/filter_dialog.h b/ui/qt/filter_dialog.h
index 323d17ae31..e2dc8fa1e1 100644
--- a/ui/qt/filter_dialog.h
+++ b/ui/qt/filter_dialog.h
@@ -12,7 +12,10 @@
#include "geometry_state_dialog.h"
-//class CaptureFilterSyntaxWorker;
+#include <ui/qt/models/filter_list_model.h>
+
+class QSortFilterProxyModel;
+class QItemSelection;
class FilterTreeDelegate;
namespace Ui {
@@ -28,24 +31,22 @@ public:
explicit FilterDialog(QWidget *parent = 0, FilterType filter_type = CaptureFilter, const QString new_filter = QString());
~FilterDialog();
-protected:
- void showEvent(QShowEvent * event);
-
private:
Ui::FilterDialog *ui;
+ FilterListModel * model_;
+ QSortFilterProxyModel * sortModel_;
+
enum FilterType filter_type_;
-// CaptureFilterSyntaxWorker *syntax_worker_;
FilterTreeDelegate *filter_tree_delegate_;
- QString new_filter_;
void addFilter(QString name, QString filter, bool start_editing = false);
private slots:
void updateWidgets();
-// void setFilterSyntaxState(QString filter, bool valid, QString err_msg);
- void on_filterTreeWidget_itemSelectionChanged();
+ void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
+
void on_newToolButton_clicked();
void on_deleteToolButton_clicked();
void on_copyToolButton_clicked();
@@ -66,18 +67,13 @@ class FilterTreeDelegate : public QStyledItemDelegate
Q_OBJECT
public:
- FilterTreeDelegate(QObject *parent, FilterDialog::FilterType filter_type) :
- QStyledItemDelegate(parent),
- filter_type_(filter_type)
- {}
- ~FilterTreeDelegate() {}
+ FilterTreeDelegate(QObject *parent, FilterDialog::FilterType filter_type);
- QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
+ virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override;
private:
FilterDialog::FilterType filter_type_;
-
-private slots:
};
#endif // FILTER_DIALOG_H