GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
filter_menu.h
1 
8 #ifndef FILTER_MENU
9 #define FILTER_MENU
10 
11 // Qt-imports
12 #include <QWidget>
13 #include <QCheckBox>
14 #include <QObject>
15 #include <QPushButton>
16 #include <QLineEdit>
17 #include <QGridLayout>
18 #include <QMessageBox>
19 #include <QStandardItemModel>
20 #include <QPair>
21 #include <QFormLayout>
22 #include <QLabel>
23 #include <QDialogButtonBox>
24 #include <QComboBox>
25 #include <QMenu>
26 #include <QAction>
27 #include <QVariant>
28 #include <QInputDialog>
29 
30 // General imports
31 #include <string>
32 #include <vector>
33 #include <iostream>
34 
35 // Local includes
36 #include "filter_menu_header.h"
37 #include "filter_model.h"
38 #include "mem_type.h"
39 
40 // The UI component itself
41 #include "ui_filter_menu.h"
42 
43 class FilterMenu : public QWidget, private Ui::FilterMenu {
44  Q_OBJECT
45 
46  public:
47 
53  FilterMenu(bool formatting_properties = false, QWidget* parent = 0);
54 
55  ~FilterMenu();
56 
61  void setModel(QStandardItemModel* model);
62 
67  QStandardItemModel* model();
68 
73  void add_filters(QList<QList<QStandardItem*> >* filters);
74 
79  QList<QList<QStandardItem*> >* get_filters();
80 
85  void create_new_filter(QString filter_type);
86 
87  private:
93  QStringList inputDialog(std::string message);
94 
100  bool check_if_filter_exists(std::string filter_name);
101 
103  bool formatting_properties_;
104 
105  protected:
107  QStandardItemModel* model_;
108 
109  public slots:
110 
115  void change_state_of_all_filters(bool state);
116 
120  void reset();
121 
127  void update(const QModelIndex& start, const QModelIndex& end);
128 
136  void insert(const QModelIndex& parent, int start, int end, bool updated = false);
137 
144  void remove(const QModelIndex& parent, int start, int end);
145 
149  void resetAllFilters();
150 
154  void resetFilter();
155 
160  void onContextMenu(const QPoint& point);
161 
166  void create_menu_action(QAction* action);
167 
168  signals:
173  void filtersReset();
174 
179  void filterRemoved(std::string filter_name);
180 
193  void filterUpdated(std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map<std::string, std::string> params, bool last);
194 
207  void filterInserted(std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map<std::string, std::string> params, bool last);
208 
209 };
210 
211 #endif
QList< QList< QStandardItem * > > * get_filters()
Definition: filter_menu.cc:254
QStandardItemModel * model_
Internal model.
Definition: filter_menu.h:107
void filterUpdated(std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last)
void resetFilter()
Definition: filter_menu.cc:126
void filterRemoved(std::string filter_name)
void resetAllFilters()
Definition: filter_menu.cc:121
Definition: filter_menu.h:43
void create_menu_action(QAction *action)
Definition: filter_menu.cc:165
void setModel(QStandardItemModel *model)
Definition: filter_menu.cc:27
void reset()
Definition: filter_menu.cc:51
void update(const QModelIndex &start, const QModelIndex &end)
Definition: filter_menu.cc:55
QStandardItemModel * model()
Definition: filter_menu.cc:23
void create_new_filter(QString filter_type)
Definition: filter_menu.cc:169
void filtersReset()
void onContextMenu(const QPoint &point)
Definition: filter_menu.cc:135
FilterMenu(bool formatting_properties=false, QWidget *parent=0)
Definition: filter_menu.cc:5
void filterInserted(std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last)
void change_state_of_all_filters(bool state)
Definition: filter_menu.cc:268
Definition: ui_filter_menu.h:68
void insert(const QModelIndex &parent, int start, int end, bool updated=false)
Definition: filter_menu.cc:76
void add_filters(QList< QList< QStandardItem * > > *filters)
Definition: filter_menu.cc:262