Hi everyone!
I have created a QTabWidget and I set the tabsClosable to true and I have also connected it to a slot like this:
connect(onglets,SIGNAL(tabCloseRequested(int)),this,SLOT(onfermerOnglet(int)));
Next, I implemented the onfermerOnglet(int i) slot like this:
void MainWindow::onfermerOnglet(int index){
onglets->removeTab(onglets->currentIndex());
}
where onglets is a tabwidget.
When I execute my code, create some widgets (maybe 5) and I remove one (maybe the index ->2) it also removes all tab index above (it removes index 2, index 3 and index 4) instead of just removing tab index 2. Can someone help me?
↧