View Full Version : How to get rid of red outline on button last clicked?

23rd January 2013, 06:44
Hi All,

I have some custom round qpushbuttons that look great until you click on them. Then I'm getting an ugly red shaded square showing that it's the last button clicked. How do I keep that square from appearing?

Brian Keeney

23rd January 2013, 09:29

Could you please show some code? Particularly the part you draw the QPushButton(i.e. paintEvent(...) method). Did you handle the style when the button is pressed?

23rd January 2013, 13:10
It is the focus rect - I guess. Try to use our search function and you will find this question asked multiple times.

23rd January 2013, 18:59
Thanks guys! The solution turns out to be a menu item in the qpushbutton-- set focus: no focus.