Action Button Indicator Colours

More
6 years 7 months ago #159610 by phillc54
Is it possible to set actionbutton indicator colours from a qss stylesheet?

Please Log in to join the conversation.

More
6 years 7 months ago #159614 by cmorley
If you are speaking of the LED indicators on the button - no
The buttons them self can be.

making custom stylesheet aware widgets seems to be a future project of Qt IIRC

Chris

Please Log in to join the conversation.

More
6 years 7 months ago #159617 by phillc54

cmorley wrote: If you are speaking of the LED indicators on the button - no

That's a shame... and a lazy me not wanting to change them all in Designer.

Please Log in to join the conversation.

More
6 years 7 months ago #159624 by cmorley
I'm happy to find out I'm wrong - but it took a while to find it on the net.
It's even easy and didn't require code changes.
Add this to the stylesheet (this covers all indicated buttons)
Code:
Indicated_PushButton{ qproperty-on_color: #000; qproperty-off_color: #444; }

Please Log in to join the conversation.

More
6 years 7 months ago #159625 by phillc54

cmorley wrote: I'm happy to find out I'm wrong - but it took a while to find it on the net.
It's even easy and didn't require code changes.
Add this to the stylesheet (this covers all indicated buttons)

Code:
Indicated_PushButton{ qproperty-on_color: #000; qproperty-off_color: #444; }


Many thanks Chris, it works a treat.

I have spent most of the day on working around it but now it is easy. I searched for "pyqt indicated_pushbutton" but came up empty except for a couple of references to QtVCP.

On another note I am a bit confused with the STATUS library. For instance I see in a handler file:
Code:
STAT.connect('all-homed', self.all_homed) STAT.connect('not-all-homed', lambda w, list: self.set_dro_homed(False))
So I tried to find where this comes from. If I do a dir of STAT it prints a "is_all_homed" but not what I was expecting.

Please Log in to join the conversation.

More
6 years 7 months ago #159626 by cmorley
indicated_pushbutton are a custom widget built in qtvcp by subclassing a QPushButton - so qtvcp's docs is the only place you will find them.

STAT is a custom library for qtvcp based on gladevcp's GStat.
linuxcnc.org/docs/2.8/html/gui/GStat.html#cha:GStat

Please Log in to join the conversation.

More
6 years 7 months ago #159627 by phillc54

cmorley wrote: indicated_pushbutton are a custom widget built in qtvcp by subclassing a QPushButton - so qtvcp's docs is the only place you will find them.

OK, that makes sense now.


STAT is a custom library for qtvcp based on gladevcp's GStat.
linuxcnc.org/docs/2.8/html/gui/GStat.html#cha:GStat

So it uses the same messages and functions?

Please Log in to join the conversation.

More
6 years 7 months ago #159628 by cmorley
yes same messages, in fact lots of the messages do something in qtvcp and not in Gladevcp at the moment. These are the descriptions that say 'depends on widget/library'

Please Log in to join the conversation.

More
6 years 7 months ago #159629 by phillc54

cmorley wrote: yes same messages, in fact lots of the messages do something in qtvcp and not in Gladevcp at the moment. These are the descriptions that say 'depends on widget/library'

Great, thanks again. I now have enough to keep me going for a while until the next question. :)

Please Log in to join the conversation.

More
6 years 7 months ago #159630 by cmorley
About indicated_pushbuttons - I should say that the QT docs for QPuchbuttons apply to indicated_buttons there is just a lot of extra code on top of them.

Hopefully we can work on the docs - so when you are finished maybe you can tell me what would be helpful, such as more detail here and small example there etc.

Chris

Please Log in to join the conversation.

Time to create page: 0.120 seconds
Powered by Kunena Forum