I have implemented a simple help file viewer using a
QTreeView for content navigation and a
QListView for bookmarks, both laid out in separate
QFrame widgets which themselves are laid out vertically in a
QSplitter. These occupy the left-hand part of the main window. The right-hand side has a
QTextBrowser laid out in another
QFrame, and this is laid out together with the other splitter horizontally in a second splitter. Everything seems to work, except that I would like to give the user visual feedback as to which pane has the current focus.
I can navigate the panes by using the F6 key. To show the user which pane is current, I tried setting the background color of the frame containing the focussed widget to green and when it loses focus back to light gray, hoping that just the margin around the widget would change color. I have set up an event filter to trap the FocusIn and FocusOut events, which seems to work.
But, although I have sized the grid layouts which hold the different views so that there is a 6-pixel wide margin between the frame and its widget, I do not see any color change (using the palette of the frame and setting the color role = Background. The only time I see a change is when I tried to set the Base color of the palette, but then everything turns black (including the background of the widgets inside of the frame!)
I know there must be a way...