TJSonic
20th October 2010, 15:56
So, i create tabs with close button.
Connected close signal with close slot
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
and here is the close slot:
void MainWindow::closeTab(int idx1)
{
tabWidget->removeTab(idx1);
}
http://allsonic.com.ua/uploads/posts/2010-10/1287586522_tab1.jpg
if i trying to close the second tab im reciving
http://allsonic.com.ua/uploads/posts/2010-10/1287586484_tab2.jpg
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??
Connected close signal with close slot
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
and here is the close slot:
void MainWindow::closeTab(int idx1)
{
tabWidget->removeTab(idx1);
}
http://allsonic.com.ua/uploads/posts/2010-10/1287586522_tab1.jpg
if i trying to close the second tab im reciving
http://allsonic.com.ua/uploads/posts/2010-10/1287586484_tab2.jpg
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??