@@ -3,6 +3,8 | |||||
3 |
|
3 | |||
4 | #include "Visualization/IVisualizationWidget.h" |
|
4 | #include "Visualization/IVisualizationWidget.h" | |
5 |
|
5 | |||
|
6 | #include <Common/spimpl.h> | |||
|
7 | ||||
6 | #include <QWidget> |
|
8 | #include <QWidget> | |
7 |
|
9 | |||
8 | class VisualizationZoneWidget; |
|
10 | class VisualizationZoneWidget; | |
@@ -15,7 +17,7 class VisualizationTabWidget : public QWidget, public IVisualizationWidget { | |||||
15 | Q_OBJECT |
|
17 | Q_OBJECT | |
16 |
|
18 | |||
17 | public: |
|
19 | public: | |
18 | explicit VisualizationTabWidget(QWidget *parent = 0); |
|
20 | explicit VisualizationTabWidget(const QString &name = {}, QWidget *parent = 0); | |
19 | virtual ~VisualizationTabWidget(); |
|
21 | virtual ~VisualizationTabWidget(); | |
20 |
|
22 | |||
21 | /// Add a zone widget |
|
23 | /// Add a zone widget | |
@@ -34,6 +36,9 public: | |||||
34 |
|
36 | |||
35 | private: |
|
37 | private: | |
36 | Ui::VisualizationTabWidget *ui; |
|
38 | Ui::VisualizationTabWidget *ui; | |
|
39 | ||||
|
40 | class VisualizationTabWidgetPrivate; | |||
|
41 | spimpl::unique_impl_ptr<VisualizationTabWidgetPrivate> impl; | |||
37 | }; |
|
42 | }; | |
38 |
|
43 | |||
39 | #endif // SCIQLOP_VISUALIZATIONTABWIDGET_H |
|
44 | #endif // SCIQLOP_VISUALIZATIONTABWIDGET_H |
@@ -3,9 +3,16 | |||||
3 |
|
3 | |||
4 | #include "Visualization/VisualizationZoneWidget.h" |
|
4 | #include "Visualization/VisualizationZoneWidget.h" | |
5 |
|
5 | |||
|
6 | struct VisualizationTabWidget::VisualizationTabWidgetPrivate { | |||
|
7 | explicit VisualizationTabWidgetPrivate(const QString &name) : m_Name{name} {} | |||
6 |
|
8 | |||
7 | VisualizationTabWidget::VisualizationTabWidget(QWidget *parent) |
|
9 | QString m_Name; | |
8 | : QWidget{parent}, ui{new Ui::VisualizationTabWidget} |
|
10 | }; | |
|
11 | ||||
|
12 | VisualizationTabWidget::VisualizationTabWidget(const QString &name, QWidget *parent) | |||
|
13 | : QWidget{parent}, | |||
|
14 | ui{new Ui::VisualizationTabWidget}, | |||
|
15 | impl{spimpl::make_unique_impl<VisualizationTabWidgetPrivate>(name)} | |||
9 | { |
|
16 | { | |
10 | ui->setupUi(this); |
|
17 | ui->setupUi(this); | |
11 | } |
|
18 | } | |
@@ -45,5 +52,5 void VisualizationTabWidget::close() | |||||
45 |
|
52 | |||
46 | QString VisualizationTabWidget::name() const |
|
53 | QString VisualizationTabWidget::name() const | |
47 | { |
|
54 | { | |
48 | return QStringLiteral("MainView"); |
|
55 | return impl->m_Name; | |
49 | } |
|
56 | } |
@@ -32,8 +32,9 VisualizationWidget::VisualizationWidget(QWidget *parent) | |||||
32 | }; |
|
32 | }; | |
33 |
|
33 | |||
34 | auto addTabView = [this, enableMinimumCornerWidgetSize]() { |
|
34 | auto addTabView = [this, enableMinimumCornerWidgetSize]() { | |
35 |
auto |
|
35 | auto widget = new VisualizationTabWidget{QString{"View %1"}.arg(ui->tabWidget->count() + 1), | |
36 |
|
|
36 | ui->tabWidget}; | |
|
37 | auto index = ui->tabWidget->addTab(widget, widget->name()); | |||
37 | if (ui->tabWidget->count() > 0) { |
|
38 | if (ui->tabWidget->count() > 0) { | |
38 | enableMinimumCornerWidgetSize(false); |
|
39 | enableMinimumCornerWidgetSize(false); | |
39 | } |
|
40 | } |
General Comments 0
You need to be logged in to leave comments.
Login now