forked from facontidavide/PlotJuggler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabbedplotwidget.h
120 lines (74 loc) · 2.44 KB
/
tabbedplotwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef TABBEDPLOTWIDGET_H
#define TABBEDPLOTWIDGET_H
#include <QWidget>
#include <QMainWindow>
#include <QTableWidget>
#include <QDomDocument>
#include "plot_docker.h"
class TabbedPlotWidget : public QWidget
{
Q_OBJECT
public:
typedef struct
{
} MainWindowArea;
explicit TabbedPlotWidget(QString name, QMainWindow* main_window,
PlotDataMapRef& mapped_data, QMainWindow* parent);
PlotDocker* currentTab();
QTabWidget* tabWidget();
const QTabWidget* tabWidget() const;
PlotDocker* addTab(QString name);
QDomElement xmlSaveState(QDomDocument& doc) const;
bool xmlLoadState(QDomElement& tabbed_area);
~TabbedPlotWidget() override;
QString name() const
{
return _name;
}
static const std::map<QString, TabbedPlotWidget*>& instances();
static TabbedPlotWidget* instance(const QString& key);
void setControlsVisible(bool visible);
public slots:
void setStreamingMode(bool streaming_mode);
// static void saveTabImage(QString fileName, PlotDocker* matrix);
void on_stylesheetChanged(QString style_dir);
private slots:
void on_renameCurrentTab();
// void on_savePlotsToFile();
void on_addTabButton_pressed();
void on_tabWidget_currentChanged(int index);
void on_tabWidget_tabCloseRequested(int index);
void on_buttonLinkHorizontalScale_toggled(bool checked);
void on_requestTabMovement(const QString& destination_name);
void on_moveTabIntoNewWindow();
// TODO void onMoveWidgetIntoNewTab(QString plot_name);
void paintEvent(QPaintEvent* event) override;
private:
QTabWidget* _tabWidget;
QPushButton* _buttonHorizontalLink;
QPushButton* _buttonLegend;
QPushButton* _buttonAddTab;
// TODO QAction* _action_savePlots;
// QMenu* _tab_menu;
const QString _name;
QMainWindow* _main_window;
PlotDataMapRef& _mapped_data;
bool _horizontal_link;
QString _parent_type;
virtual void closeEvent(QCloseEvent* event) override;
// void printPlotsNames();
protected:
virtual bool eventFilter(QObject* obj, QEvent* event) override;
static std::map<QString, TabbedPlotWidget*> _instances;
signals:
void created();
void undoableChange();
void tabAdded(PlotDocker*);
void sendTabToNewWindow(PlotDocker*);
};
#endif // TABBEDPLOTWIDGET_H