lets say you have 3 tabs, index 0, 1, 2
ui->Pestanas->setCurrentIndex(0);
ui->Pestanas->removeTab(1);
ui->Pestanas->removeTab(2);
ui->Pestanas->setCurrentIndex(0);
ui->Pestanas->removeTab(1);
ui->Pestanas->removeTab(2);
To copy to clipboard, switch view to plain text mode
You set current tab to first tab. //index 0
And you removed 2nd tab with //ui->Pestanas->removeTab(1); //index 1
Now tab indexes will changed, now tab indexes you have are : 0, 1
And now you are trying to remove 3rd Tab(index 2) which is not there //ui->Pestanas->removeTab(2);
Try this:
ui->Pestanas->removeTab(1);
ui->Pestanas->removeTab(1);
ui->Pestanas->removeTab(1);
ui->Pestanas->removeTab(1);
To copy to clipboard, switch view to plain text mode
Bookmarks