I have a QLineEdit inside a widget inside a QTabWidget. Let’s say that tab is at tab index 2. When currently active tab is at index 1, and I call setFocus() (and show(), and raise()) on the QLineEdit, the active tab doesn’t switch to index 2 to show the focused widget.
Is there any elegant way to show the focused widget’s tab when that widget gets focus?
Thanks!
Here’s a more generic function to switch to the tab containing a widget:
It’s not tested but you should get the idea of how it works.