Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

close the correct tab

$
0
0
Hey everyone! I have a QTabWidget. When I click the close button on the tab, it emits tabCloseRequested() and calls the following slot: void mainView::closeTab(int index) {     tabWidget->removeTab(tabWidget->currentIndex()); } The slot closes the current tab. For example imagine you have 3 tabs open (labeled 1, 2, and 3). If I am currently on tab 2, and I click the close tab button on tab 3, tab 2 still closes. I would like the tab with the button clicked to close, regardless of which tab I am on. I believe my problem lies in removing currentIndex(), but I am not sure of a better way to do this. Thanks for your help!

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images