How to connect event when tab widget is selected?
Asked Answered
M

1

8

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.

Marchak answered 24/1, 2015 at 3:7 Comment(0)
A
8

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.

Assiut answered 24/1, 2015 at 4:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.