Command like "Qtab Clicked Connect" that can call a function?
Solved
General and Desktop
-
@msyasak
If you are using aQTabWidget
, then the signal is on that, not on the "tab widgets` themselves. In Python it will be:self.qtabwidget.currentChanged.connect(self.tabChanged) def tabChanged(index: int): print(index) print(self.qtabwidget.widget(index)) print(self.qtabwidget.currentWidget())
-
@JonB actually, I need the call a function when clicked a tab.
For instance, in button circumstance - there is a connect() function as you mentioned that is
self.qt_button.clicked.connect(self.function)
But, I need such as above command that provide clicked a tab.
-
@msyasak
If you are using aQTabWidget
, then the signal is on that, not on the "tab widgets` themselves. In Python it will be:self.qtabwidget.currentChanged.connect(self.tabChanged) def tabChanged(index: int): print(index) print(self.qtabwidget.widget(index)) print(self.qtabwidget.currentWidget())