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 <QDomDocument>
8 #include "plot_docker.h"
9 
10 class TabbedPlotWidget : public QWidget
11 {
12  Q_OBJECT
13 
14 public:
15  typedef struct
16  {
18 
19  explicit TabbedPlotWidget(QString name,
20  QMainWindow* main_window,
21  PlotDataMapRef& mapped_data,
22  QMainWindow* parent);
23 
25 
26  QTabWidget* tabWidget();
27 
28  const QTabWidget* tabWidget() const;
29 
30  PlotDocker* addTab(QString name);
31 
32  QDomElement xmlSaveState(QDomDocument& doc) const;
33 
34  bool xmlLoadState(QDomElement& tabbed_area);
35 
36  ~TabbedPlotWidget() override;
37 
38  QString name() const
39  {
40  return _name;
41  }
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, PlotDocker* matrix);
54 
55  void on_stylesheetChanged(QString style_dir);
56 
57 private slots:
58 
59  void on_renameCurrentTab();
60 
61  //void on_savePlotsToFile();
62 
64 
65  void on_tabWidget_currentChanged(int index);
66 
67  void on_tabWidget_tabCloseRequested(int index);
68 
69  void on_buttonLinkHorizontalScale_toggled(bool checked);
70 
71  void on_requestTabMovement(const QString& destination_name);
72 
74 
75  // TODO void onMoveWidgetIntoNewTab(QString plot_name);
76 
77  void paintEvent(QPaintEvent* event) override;
78 
79 private:
80 
81  QTabWidget* _tabWidget;
82 
83  QPushButton* _buttonHorizontalLink;
84  QPushButton* _buttonLegend;
85  QPushButton* _buttonAddTab;
86 
87  // TODO QAction* _action_savePlots;
88 
89  // QMenu* _tab_menu;
90 
91  const QString _name;
92 
93  QMainWindow* _main_window;
94 
96 
98 
99  QString _parent_type;
100 
101  virtual void closeEvent(QCloseEvent* event) override;
102 
103  // void printPlotsNames();
104 
105 protected:
106  virtual bool eventFilter(QObject* obj, QEvent* event) override;
107 
108  static std::map<QString, TabbedPlotWidget*> _instances;
109 
110 signals:
111  void created();
112  void undoableChange();
113  void tabAdded(PlotDocker*);
115 };
116 
117 #endif // TABBEDPLOTWIDGET_H
TabbedPlotWidget(QString name, QMainWindow *main_window, PlotDataMapRef &mapped_data, QMainWindow *parent)
void on_stylesheetChanged(QString style_dir)
void on_tabWidget_currentChanged(int index)
void on_buttonLinkHorizontalScale_toggled(bool checked)
QMainWindow * _main_window
static std::map< QString, TabbedPlotWidget * > _instances
void on_requestTabMovement(const QString &destination_name)
QString name() const
void tabAdded(PlotDocker *)
~TabbedPlotWidget() override
PlotDataMapRef & _mapped_data
void sendTabToNewWindow(PlotDocker *)
PlotDocker * currentTab()
void paintEvent(QPaintEvent *event) override
bool xmlLoadState(QDomElement &tabbed_area)
void setStreamingMode(bool streaming_mode)
QPushButton * _buttonHorizontalLink
QPushButton * _buttonAddTab
QTabWidget * tabWidget()
static TabbedPlotWidget * instance(const QString &key)
virtual void closeEvent(QCloseEvent *event) override
QPushButton * _buttonLegend
QTabWidget * _tabWidget
virtual bool eventFilter(QObject *obj, QEvent *event) override
QDomElement xmlSaveState(QDomDocument &doc) const
void setControlsVisible(bool visible)
void on_tabWidget_tabCloseRequested(int index)
PlotDocker * addTab(QString name)
const QString _name
static const std::map< QString, TabbedPlotWidget * > & instances()


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:48