##// END OF EJS Templates
Merge pull request 140 from SCIQLOP-Initialisation feature/VisualizationWidget...
perrinel -
r88:626323acfce7 merge
parent child
Show More
@@ -1,8 +1,11
1 #ifndef SCIQLOP_VISUALIZATIONWIDGET_H
1 #ifndef SCIQLOP_VISUALIZATIONWIDGET_H
2 #define SCIQLOP_VISUALIZATIONWIDGET_H
2 #define SCIQLOP_VISUALIZATIONWIDGET_H
3
3
4 #include <QLoggingCategory>
4 #include <QWidget>
5 #include <QWidget>
5
6
7 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationWidget)
8
6 namespace Ui {
9 namespace Ui {
7 class VisualizationWidget;
10 class VisualizationWidget;
8 } // namespace Ui
11 } // namespace Ui
@@ -1,10 +1,40
1 #include "visualization/VisualizationWidget.h"
1 #include "visualization/VisualizationWidget.h"
2 #include "ui_VisualizationWidget.h"
2 #include "ui_VisualizationWidget.h"
3 #include "visualization/VisualizationTabWidget.h"
4
5 #include <QDebug>
6 #include <QToolButton>
7
8 #include "iostream"
9
10 Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
3
11
4 VisualizationWidget::VisualizationWidget(QWidget *parent)
12 VisualizationWidget::VisualizationWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::VisualizationWidget)
13 : QWidget(parent), ui(new Ui::VisualizationWidget)
6 {
14 {
7 ui->setupUi(this);
15 ui->setupUi(this);
16
17 auto *addTabViewButton = new QToolButton(ui->tabWidget);
18 addTabViewButton->setText("Add View");
19 addTabViewButton->setCursor(Qt::ArrowCursor);
20 addTabViewButton->setAutoRaise(true);
21 ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
22
23 auto addTabView = [&](bool checked) {
24 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
25 QString("View %1").arg(ui->tabWidget->count() + 1));
26 qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
27 };
28
29 auto removeTabView = [&](int index) {
30 ui->tabWidget->removeTab(index);
31 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
32 };
33
34 ui->tabWidget->setTabsClosable(true);
35
36 connect(addTabViewButton, &QToolButton::clicked, addTabView);
37 connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
8 }
38 }
9
39
10 VisualizationWidget::~VisualizationWidget()
40 VisualizationWidget::~VisualizationWidget()
@@ -19,20 +19,23
19 <property name="currentIndex">
19 <property name="currentIndex">
20 <number>0</number>
20 <number>0</number>
21 </property>
21 </property>
22 <widget class="QWidget" name="firstView">
22 <widget class="VisualizationTabWidget" name="firstView">
23 <attribute name="title">
23 <attribute name="title">
24 <string>View 1</string>
24 <string>View 1</string>
25 </attribute>
25 </attribute>
26 </widget>
26 </widget>
27 <widget class="QWidget" name="secondView">
28 <attribute name="title">
29 <string>+</string>
30 </attribute>
31 </widget>
32 </widget>
27 </widget>
33 </item>
28 </item>
34 </layout>
29 </layout>
35 </widget>
30 </widget>
31 <customwidgets>
32 <customwidget>
33 <class>VisualizationTabWidget</class>
34 <extends>QWidget</extends>
35 <header location="global">visualization/VisualizationTabWidget.h</header>
36 <container>1</container>
37 </customwidget>
38 </customwidgets>
36 <resources/>
39 <resources/>
37 <connections/>
40 <connections/>
38 </ui>
41 </ui>
General Comments 3
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 6 added
  * 3 removed

Changed files:
  * A gui/src/Visualization/VisualizationWidget.cpp
  * A gui/include/SidePane/SqpSidePane.h
  * A gui/include/Visualization/VisualizationGraphWidget.h
  * A gui/include/Visualization/VisualizationTabWidget.h
  * A gui/include/Visualization/VisualizationWidget.h
  * A gui/include/Visualization/VisualizationZoneWidget.h
  * A gui/include/Visualization/qcustomplot.h
  * A gui/src/SidePane/SqpSidePane.cpp
  * A gui/src/Visualization/VisualizationGraphWidget.cpp
  * A gui/src/Visualization/VisualizationTabWidget.cpp
  * A gui/src/Visualization/VisualizationZoneWidget.cpp
  * A gui/src/Visualization/qcustomplot.cpp
  * M gui/include/DataSource/DataSourceWidget.h
  * M gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * M gui/src/DataSource/DataSourceWidget.cpp
  * M app/src/Main.cpp
  * M app/src/MainWindow.cpp
  * M app/ui/MainWindow.ui
  * M core/include/DataSource/DataSourceController.h
  * M core/src/DataSource/DataSourceController.cpp
  * M core/tests/DataSource/TestDataSourceController.cpp
  * M gui/ui/visualization/VisualizationWidget.ui
  * M gui/vera-exclusions/exclusions.txt
  * M gui/src/visualization/VisualizationWidget.cpp
  * R cmake/sciqlop_package_qt.cmake
  * R core/include/Plugin/PluginManager.h
  * R core/include/Visualization/VisualizationController.h
  * R core/src/Plugin/PluginManager.cpp
  * R core/src/Visualization/VisualizationController.cpp
  * R gui/include/sidepane/SqpSidePane.h
  * R gui/include/visualization/VisualizationGraphWidget.h
  * R gui/include/visualization/VisualizationTabWidget.h
  * R gui/include/visualization/VisualizationWidget.h
  * R gui/include/visualization/VisualizationZoneWidget.h
  * R gui/include/visualization/qcustomplot.h
  * R gui/src/sidepane/SqpSidePane.cpp
  * R gui/src/visualization/VisualizationGraphWidget.cpp
  * R gui/src/visualization/VisualizationTabWidget.cpp
  * R gui/src/visualization/VisualizationZoneWidget.cpp
  * R gui/src/visualization/qcustomplot.cpp
  * R gui/ui/sidepane/SqpSidePane.ui
  * R gui/ui/visualization/VisualizationGraphWidget.ui
  * R gui/ui/visualization/VisualizationTabWidget.ui
  * R gui/ui/visualization/VisualizationZoneWidget.ui
  * R plugin/CMakeLists.txt
  * R plugin/cmake/Findsciqlop-plugin.cmake
  * R plugin/include/Plugin/IPlugin.h
  * R app/CMakeLists.txt
  * R app/include/MainWindow.h
  * R app/vera-exclusions/exclusions.txt
  * R cmake/sciqlop_applications.cmake
  * R core/CMakeLists.txt
  * R core/include/Common/spimpl.h
  * R gui/CMakeLists.txt
  * R gui/include/SqpApplication.h
  * R gui/src/SqpApplication.cpp
  * R app/src/mainwindow.ui
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now