From 4bb39eaad8dcff57c297aaf9542113d2eaed9067 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 17 May 2018 19:34:53 +0200 Subject: Make tabs closable. Load file list and master file state back into file list widget. --- src/mainwindow.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mainwindow.cc') diff --git a/src/mainwindow.cc b/src/mainwindow.cc index e7d099d..b9cf800 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -49,6 +49,8 @@ MainWindow::MainWindow(Settings& settings) tab_widget = new QTabWidget(); tab_widget->setTabsClosable(true); tab_widget->setMovable(true); + connect(tab_widget, SIGNAL(tabCloseRequested(int)), + this, SLOT(closeTab(int))); setCentralWidget(tab_widget); @@ -277,3 +279,8 @@ void MainWindow::projectChanged() project_dirty = true; updateWindowTitle(); } + +void MainWindow::closeTab(int tab) +{ + tab_widget->removeTab(tab); +} -- cgit v1.2.3