PDA

View Full Version : QTabWidget or QWidget signals



mastupristi
7th November 2016, 12:02
Hi,
I need to know when a specific tab of QTabWidget becomes active and when another tab is selected.
I found some signals QTabWidget::currentChanged(int index) or QTabWidget::tabBarClicked(int index), but I wonder if exist something more specific, maybe some signals in inner widget. This because tab are dynamic and the "target tab" can change index, so I shoud implement a messy logic to chose the right index

best regards

Killian
7th November 2016, 15:41
When it comes to dynamic UIs in most cases it's up to you to keep track of indices and stuff. You could easily react on insert, move and remove events of QTabWidget/QTabBar to keep your tabs organized.

anda_skoa
8th November 2016, 17:30
You can also always ask for the widget at a given index, so if you know how to handle a specific widget rather than an index, do that.

Cheers,
_