curvelist_panel.h
Go to the documentation of this file.
1 #ifndef CURVE_SELECTOR_H
2 #define CURVE_SELECTOR_H
3 
4 #include <QWidget>
5 #include <QAction>
6 #include <QListWidget>
7 #include <QMouseEvent>
8 #include <QStandardItemModel>
9 #include <QTableView>
10 #include <QItemSelection>
11 
13 #include "tree_completer.h"
14 
15 class SortedTableItem;
16 
17 namespace Ui {
18 class CurveListPanel;
19 }
20 
21 class CurveListPanel : public QWidget
22 {
23  Q_OBJECT
24 
25 public:
26  explicit CurveListPanel(const CustomPlotMap& mapped_math_plots,
27  QWidget *parent);
28 
29  ~CurveListPanel() override;
30 
31  int rowCount() const;
32 
33  void clear();
34 
35  void addItem(const QString& item_name);
36 
37  void refreshColumns();
38 
39  int findRowByName(const std::string &text) const;
40 
41  void removeRow(int row);
42 
43  void rebuildEntireList(const std::vector<std::string> &names);
44 
45  void updateFilter();
46 
47  QStandardItemModel *getTableModel() const
48  {
49  return _model;
50  }
51 
52  QTableView* getTableView() const;
53 
54  QTableView* getCustomView() const;
55 
56  bool is2ndColumnHidden() const
57  {
58  return getTableView()->isColumnHidden(1);
59  }
60 
61  virtual void keyPressEvent(QKeyEvent * event) override;
62 
63 private slots:
64 
65  void on_radioContains_toggled(bool checked);
66 
67  void on_radioRegExp_toggled(bool checked);
68 
69  void on_radioPrefix_toggled(bool checked);
70 
71  void on_checkBoxCaseSensitive_toggled(bool checked);
72 
73  void on_lineEdit_textChanged(const QString &search_string);
74 
75  void on_pushButtonSettings_toggled(bool checked);
76 
77  void on_checkBoxHideSecondColumn_toggled(bool checked);
78 
79  void removeSelectedCurves();
80 
81  void on_buttonAddCustom_clicked();
82 
83  void on_buttonEditCustom_clicked();
84 
85  void onCustomSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
86 
87 public slots:
88 
89  void clearSelections();
90 
91 private:
92 
93  Ui::CurveListPanel *ui;
94 
96 
97  bool _newX_modifier, _dragging;
98 
100 
101  bool eventFilter(QObject *object, QEvent *event) override;
102 
103  void updateTreeModel();
104 
105  std::vector<std::string> getNonHiddenSelectedRows();
106 
108 
109  QStandardItemModel* _model;
110 
112 
114 signals:
115 
116  void hiddenItemsChanged();
117 
118  void createMathPlot(const std::string& linked_plot);
119  void editMathPlot(const std::string& plot_name);
120  void refreshMathPlot(const std::string& curve_name);
121 
122  void deleteCurves(const std::vector<std::string>& curve_names);
123 };
124 
125 #endif // CURVE_SELECTOR_H
bool is2ndColumnHidden() const
TreeModelCompleter * _completer
QStandardItemModel * getTableModel() const
Ui::CurveListPanel * ui
std::unordered_map< std::string, CustomPlotPtr > CustomPlotMap
QPoint _drag_start_pos
const CustomPlotMap & _custom_plots
QStandardItemModel * _model


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17