tabbedplotwidget.h
Go to the documentation of this file.
1 #ifndef TABBEDPLOTWIDGET_H
2 #define TABBEDPLOTWIDGET_H
3 
4 #include <QWidget>
5 #include <QMainWindow>
6 #include <QTableWidget>
7 #include "plotmatrix.h"
8 
9 namespace Ui {
10 class TabbedPlotWidget;
11 }
12 
13 
14 class TabbedPlotWidget : public QWidget
15 {
16  Q_OBJECT
17 
18 public:
19  typedef struct{} MainWindowArea;
20 
21  explicit TabbedPlotWidget(QString name,
22  QMainWindow *main_window,
23  PlotMatrix* first_tab,
24  PlotDataMapRef &mapped_data,
25  QMainWindow *parent );
26 
27  PlotMatrix* currentTab();
28 
29  QTabWidget* tabWidget();
30 
31  const QTabWidget* tabWidget() const;
32 
33  void addTab(PlotMatrix *tab = nullptr);
34 
35  QDomElement xmlSaveState(QDomDocument &doc) const;
36 
37  bool xmlLoadState(QDomElement &tabbed_area);
38 
39  ~TabbedPlotWidget() override;
40 
41  QString name() const { return _name; }
42 
43  static const std::map<QString,TabbedPlotWidget*>& instances();
44 
45  static TabbedPlotWidget *instance(const QString& key);
46 
47  void setControlsVisible(bool visible);
48 
49 public slots:
50 
51  void setStreamingMode(bool streaming_mode);
52 
53  static void saveTabImage(QString fileName, PlotMatrix* matrix);
54 
55 private slots:
56 
57  void on_renameCurrentTab();
58 
59  void on_savePlotsToFile();
60 
61  void on_pushAddColumn_pressed();
62 
63  void on_pushVerticalResize_pressed();
64 
65  void on_pushHorizontalResize_pressed();
66 
67  void on_pushAddRow_pressed();
68 
69  void on_addTabButton_pressed();
70 
71  void on_pushRemoveEmpty_pressed();
72 
73  void on_tabWidget_currentChanged(int index);
74 
75  void on_tabWidget_tabCloseRequested(int index);
76 
77  void on_buttonLinkHorizontalScale_toggled(bool checked);
78 
79  void on_requestTabMovement(const QString &destination_name);
80 
81  void on_moveTabIntoNewWindow();
82 
83  void on_pushButtonShowLabel_pressed();
84 
85  void onLabelStatusChanged();
86 
87  void on_pushButtonZoomMax_pressed();
88 
89  void onMoveWidgetIntoNewTab(QString plot_name);
90 
91 private:
92 
93  enum LabelStatus{ LEFT, RIGHT, HIDDEN };
94 
95  Ui::TabbedPlotWidget *ui;
96 
99 
100  QMenu* _tab_menu;
101 
102  const QString _name;
103 
105 
107 
108  QString _parent_type;
109 
111 
112  virtual void closeEvent(QCloseEvent *event) override;
113 
114 protected:
115 
116  virtual bool eventFilter(QObject *obj, QEvent *event) override;
117 
118  static std::map<QString,TabbedPlotWidget*> _instances;
119 
120 signals:
121  void created();
122  void undoableChangeHappened();
123  void matrixAdded( PlotMatrix * );
124  void sendTabToNewWindow(PlotMatrix *);
125 };
126 
127 #endif // TABBEDPLOTWIDGET_H
QAction * _action_renameTab
LabelStatus _labels_status
static std::map< QString, TabbedPlotWidget * > _instances
QString name() const
PlotDataMapRef & _mapped_data
Ui::TabbedPlotWidget * ui
char name[1]
QAction * _action_savePlots
const QString _name


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