I’m currently writing a UI in Maya using Pyside2. This UI has a number of tabs. Each Tab having 3 child tabs of model names within the tabs listWidget. I’m having a problem to query the active tab. I use the self.mytab.currentWidget() method that returns a pointer (PySide2.QtWidgets.QWidget(0x2439df45d30) at 0x0000024378A0B688) which I store in a variable. But how do I use this pointer to access the selected tabs name?
Here is some code to shed some light:
# self.tab_piece is a QtWidgets.QTabWidget() that has a number of tabs with child tabs that will # be queried for selected. # Get selected pieces tab index = self.tab_pieces.currentIndex() tab_text = self.tab_pieces.tabText(index) # The above will only give me the parent name and not the active child tab name current_tab = self.tab_pieces.currentWidget() # the above returns this PySide2.QtWidgets.QWidget(0x2439df45d30) at 0x0000024378A0B688 # how to I query current_tab tab name?