PDA

View Full Version : QPushButton hightlight effect with QStyleSheet



franki
23rd September 2012, 16:19
Hi all,

What is responsible for highlighting QPushButton when you hover over it with mouse?
I attached a piece of screenshot from my app, top button is highlighted.
What is more this effect appears smoothly, looks like some animation with QTimer?

When I start messing up with QStyleSheet and border keywords this effect goes away, and I can't reproduce it with QStyleSheet.
Is it ever possible with QStyleSheet? I was trying box-shadow but with no luck - I can't observer any effect.

What I'm trying to achieve is borders that imitate 3D button, they change when I click on button, and also highlight effect when button has focus or mouse hovers over it, how to do it ?
Should I play with QStyle instead of QStyleSheet?
And is it true that QStyleSheet is compiled at run time and hence app can slow down ?
I'm using Qt 4.8.1 on Linux

best regards
Marek