Hello everyone! Here is my question:

I've derived the QToolButton so that buttons in QToolBar can be accessed by tabbing, but when it gains focus it is not highlighted like when i hover with the cursor over it. I've overriden the focusInEvent function, but when it comes to actually highlighting the button I don't know what property/attribute to set or what method to call.

Here is what it looks like when I hover with the cursor over the button:
example1.png
How can I achieve this by replacing the line marked?

Here is what is currently happening:
example2.png

Qt Code:
  1. void focusInEvent(QFocusEvent* e){
  2. if(e->gotFocus() && e->reason() == Qt::TabFocusReason){
  3. setGraphicsEffect(new QGraphicsColorizeEffect()); //line to be replaced
  4. }
  5. QToolButton::focusInEvent(e);
  6. }
To copy to clipboard, switch view to plain text mode 

Thank you for your help!