Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Removing one Tab in a QTabWidget

$
0
0
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?

Viewing all articles
Browse latest Browse all 22112

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>