Reputation: 17049
QTabWidget has signal currentChanged(). And it returns index of current tab.
But how can I get this parameter in such expression:
tabs.currentChanged.connect(lambda: foo());
def foo(index):
...
Where should I look for this parameter that was just returned?
Upvotes: 1
Views: 136
Reputation: 206879
Signals don't "return" anything. They can have parameters though, which is the case for currentIndex
. If you want that argument passed to your function, you should try:
tabs.currentChanged.connect(lambda index: foo(index));
Upvotes: 3