Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect event when tab widget is selected?

I am using PyQt5 to make the user interface. Now I have set up a tab widget, and I want to trigger the event at such a time when a specific tab is selected. In other words, for example, I have tab A and tab B, and I want to execute the function every time user is switching from tab A to tab B.

like image 402
Jarvis Du Avatar asked Jan 24 '15 03:01

Jarvis Du


1 Answers

When a new tab is selected currentChanged(int index) signal of the QTabWidget is emitted. Just connect that signal to some slot and check the index of the newly selected tab which is passed as argument.

like image 83
Nejat Avatar answered Sep 24 '22 20:09

Nejat