I have a custom widget comprised of a QFrame
housing a QWebEngineView
, which displays a <textarea/>
in its HTML.
In the following picture, the top widget is a QComboBox
, the middle widget is my custom widget, and the bottom widget is a QPushButton
. What I want is to make my custom widget have, when selected, the glowing selection border that the QComboBox
has.
My two requirements are:
- The border only shows when my custom widget is actually selected, not showing all the time.
- The style of the border (color, width, etc) should be the default style of whatever platform I'm running my app on. For example, I don't want macOS' blue selection border on Windows.
How do I go about doing this?
There is an existing question (How to add border around QWidget?), but the answer is a custom style rather than the platform default style, and doesn't explain how to make the border contingent upon selection instead of being displayed all the time.