PDA

View Full Version : QTabWidget currentChanged signal for repeated selects of a tab



balasaravanan
11th January 2011, 05:21
Hi

I am using a QTabWidget. And when a tab is selected the currentChanged signal is emitted. Now if the user clicks the current tab again for the second time, the currentChanged signal is not emitted. And from then on, any number of clicks to the current tab is not emitting currentChanged signal.

My application has a logic where the tab contents will be different for the first time user clicks the tab and the second time the user clicks the same tab.

I would like to know how to activate this signal to be emitted everytime a user clicks the same tab.

Thanks and regards,
B

tbscope
11th January 2011, 06:04
It's a good thing that QTabWidget and QTabBar can't do this.
This is a UI nightmare.

But, if you insist on doing this, you can always subclass QTabWidget and create a tabClicked signal.

The correct solution is to use another kind of widget inside the tab to do what you want.
A stacked widget together with buttons or a list widget, another tab widget, ...