##// END OF EJS Templates
Updates tab widget so it can be deleted when closed
Alexandre Leroux -
r247:83d15158feaa
parent child
Show More
@@ -36,6 +36,9 VisualizationTabWidget::VisualizationTabWidget(const QString &name, QWidget *par
36 impl{spimpl::make_unique_impl<VisualizationTabWidgetPrivate>(name)}
36 impl{spimpl::make_unique_impl<VisualizationTabWidgetPrivate>(name)}
37 {
37 {
38 ui->setupUi(this);
38 ui->setupUi(this);
39
40 // Widget is deleted when closed
41 setAttribute(Qt::WA_DeleteOnClose);
39 }
42 }
40
43
41 VisualizationTabWidget::~VisualizationTabWidget()
44 VisualizationTabWidget::~VisualizationTabWidget()
@@ -48,7 +48,13 VisualizationWidget::VisualizationWidget(QWidget *parent)
48 enableMinimumCornerWidgetSize(true);
48 enableMinimumCornerWidgetSize(true);
49 }
49 }
50
50
51 // Removes widget from tab and closes it
52 auto widget = ui->tabWidget->widget(index);
51 ui->tabWidget->removeTab(index);
53 ui->tabWidget->removeTab(index);
54 if (widget) {
55 widget->close();
56 }
57
52 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
58 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
53
59
54 };
60 };
General Comments 0
You need to be logged in to leave comments. Login now