PDA

View Full Version : Removing pressed effect from a QPushButton



Luc4
14th August 2010, 10:41
Hi! I subclassed QPushButton to create buttons which have the pressed effect by changing the icon. Seems to work ok, but I noticed that QPushButton creates a pressed effect on its own by slightly moving the icon. Is it possible to remove this effect?
Thanks!

tbscope
14th August 2010, 10:50
Probably using styles or stylesheets

Luc4
14th August 2010, 11:09
I tried to search in the reference, but I'm finding it difficult as I don't know how to call that effect. Any idea?
Thanks!

tbscope
14th August 2010, 11:43
Try this:

Create a stylesheet for a QPushButton, normal and pressed conditions.
In it, add an image. Check if it moves it around when pressing the button. If so, try to use image-position to position the image.
http://doc.qt.nokia.com/4.6/stylesheet-reference.html