So, i create tabs with close button.

Connected close signal with close slot

Qt Code:
  1. connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
To copy to clipboard, switch view to plain text mode 

and here is the close slot:
Qt Code:
  1. void MainWindow::closeTab(int idx1)
  2. {
  3. tabWidget->removeTab(idx1);
  4.  
  5. }
To copy to clipboard, switch view to plain text mode 


if i trying to close the second tab im reciving



so
if im trying to close the last tab, it works normally but if i close the second, all tabs after it are deleting too. What i do wrong??