QTabWidgets , ways to find a tab.
Solved
General and Desktop
-
Hi community !
I m currently dealing with Tabs
And I can't find a way to get the index of a tab by passing the name of this tab.I have 2 solutions :
1 - either I can get the index of the created tab at the creation step and then store it but no idea how to do that. or at least auto select the last created tab ? so from that i can get the index via currentIndex().
EDIT :
I can set the created tab by using QTabWidget.setCurentWidget(QWidget)2 - get the index based on the tab name ? Is that possible ?
Thx !
-
Hi,
You can use a loop and check the name of tab X where X is the for loop variable using the QTabBar of your QTabWidget.
Hope it helps