##// END OF EJS Templates
Add button on the SidePane widgets to open left or right inspectors
Add button on the SidePane widgets to open left or right inspectors

File last commit:

r101:9678ebc27091
r101:9678ebc27091
Show More
VisualizationWidget.cpp
43 lines | 1.4 KiB | text/x-c | CppLexer
/ gui / src / Visualization / VisualizationWidget.cpp
mv visualization -> Visualization...
r95 #include "Visualization/VisualizationWidget.h"
#include "Visualization/VisualizationTabWidget.h"
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 #include "ui_VisualizationWidget.h"
Widget of the tab widget are now of type VisualizationTabWidget...
r88
#include <QDebug>
#include <QToolButton>
#include "iostream"
Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58
VisualizationWidget::VisualizationWidget(QWidget *parent)
Modify construction of objects to use initializer list...
r91 : QWidget{parent}, ui{new Ui::VisualizationWidget}
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 {
ui->setupUi(this);
Widget of the tab widget are now of type VisualizationTabWidget...
r88
Modify construction of objects to use initializer list...
r91 auto addTabViewButton = new QToolButton{ui->tabWidget};
addTabViewButton->setText(tr("Add View"));
Widget of the tab widget are now of type VisualizationTabWidget...
r88 addTabViewButton->setCursor(Qt::ArrowCursor);
addTabViewButton->setAutoRaise(true);
ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
Add button on the SidePane widgets to open left or right inspectors
r101 auto addTabView = [&]() {
Widget of the tab widget are now of type VisualizationTabWidget...
r88 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
QString("View %1").arg(ui->tabWidget->count() + 1));
qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
};
auto removeTabView = [&](int index) {
ui->tabWidget->removeTab(index);
qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
};
ui->tabWidget->setTabsClosable(true);
connect(addTabViewButton, &QToolButton::clicked, addTabView);
connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 }
VisualizationWidget::~VisualizationWidget()
{
delete ui;
}