Hi, my application has a QTabWidget object and each tab consists of an editor. What I would like is that if my QTabWidget object gets the focus, then the editor of the current tab should automatically get the focus.
I have been able to get this to work to an extent (e.g. when switching from one tab to another), but when another widget in my application has the focus and that I then click on the active tab of my QTabWidget object, the editor for that tab doesn't get the focus. I need to switch to another tab and back to get the focus which is clearly not what I want. On the other hand, if another widget in my application has the focus and that I then click on a non-active tab in my QTabWidget object, then the editor for that tab gets the focus, as expected since I take advantage of the QTabWidget::currentChanged signal to give the focus to the editor for the active tab.
I have looked into overriding the QTabWidget::focusInEvent, but to no avail. I also thought I might get it to work by using QTabWidget::setFocusProxy, but still to no avail. Otherwise, yes, I do have given a strong focus policy to my QTabWidget object, since I want my QTabWidget object to accept focus by both tabbing and clicking (and tabbing works perfectly fine indeed).
So... any idea of how I could achieve what I am after?...
Bookmarks