FACT++  1.0
void MainWindow::on_fTabWidget_tabCloseRequested ( int  which)
privateslot

Definition at line 145 of file MainWindow.cc.

146 {
147  // To get the correct size we have to switch to this tab
148  // An alternative would be to take the size of the current tab
149  fTabWidget->setCurrentIndex(which);
150 
151  QWidget *w = fTabWidget->currentWidget(); //fTabWidget->widget(which);
152  if (!w)
153  {
154  cout << "Weird... the tab requested to be closed doesn't exist!" << endl;
155  return;
156  }
157 
158  QDockWidget *d = w->findChild<QDockWidget*>();
159  if (!d)
160  {
161  cout << "Sorry, tab requested to be closed contains no QDockWidget!" << endl;
162  return;
163  }
164 
165  new DockWindow(d, fTabWidget->tabText(which));
166  fTabWidget->removeTab(which);
167 
168  if (fTabWidget->count()==1)
169  fTabWidget->setTabsClosable(false);
170 }
A main window which can be used to display a QDockWidget from a tab.
Definition: DockWindow.h:10