[Interest] Custom QPushButton

Bernhard Seßler bernhard.sessler at corscience.de
Fri Nov 22 07:53:43 CET 2013


Hi,

or, even shorter:

---8<---

QPushButton,
QPushButton:hover,
QPushButton:pressed,
QPushButton:default,
PushButton:disabled
{
// common content
}

--->8---

Regards,
Bernhard


On 21.11.2013 18:00, William Hallatt wrote:
> Hi Graham,
> 
> If I remember correctly, you should be able to do that with stylesheets
> also, e.g if you don't want the button to change, ever, you could do
> something like this:
> 
> QPushButton
> {
> // content is the same as all the others
> }
> 
> QPushButton:hover
> {
> // content is the same as all the others
> }
> 
> QPushButton:pressed
> {
> // content is the same as all the others
> }
> 
> QPushButton:default
> {
> // content is the same as all the others
> }
> 
> QPushButton:disabled
> {
> // content is the same as all the others
> }
> 
> Hope that makes sense.
> 
> William.
> 
> 
> On 21 November 2013 18:49, Graham Labdon
> <Graham.Labdon at avalonsciences.com>wrote:
> 
>>  Hi
>> How can I stop the appearance of a QPushButton changing when it is hovered
>> over or pressed.
>> I know how to change the background colour for these events by setting the
>> appropriate stylesheet, but cannot see how I can stop them changing at all.
>> I would appreciate some help in getting this working
>>
>> Thanks
>>
>>
>>
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
> 
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
> 



More information about the Interest mailing list