Important: Please read the Qt Code of Conduct -

Highlighting widget

  • I have a couple of dock widgets with multiple tabs in each. It can happen that I have to programmatically change the focus and the active tab of a dock widget. In that case I'd like to highlight the widget with a simple and short "flash" animation.
    As Qt doesn't seem to support such behavior by default I took a look at QPropertyAnimation and used this to change the background color. However, obviously this is not a good solution as I'd have to reset the background color property back to its initial state after the animation.
    Hence my question: What is the proper way of highlighting a QWidget with a simple flash animation to show draw the users attention on a certain widget? Would it make sense to overlay a QRubberBand and change it's opacity level using QPropertyAnimation?

    I'd be thankful for any kind of suggestion.

Log in to reply