Action Button Indicator Colours

  • phillc54
  • phillc54's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
09 Mar 2020 23:42 #159610 by phillc54
Action Button Indicator Colours was created by phillc54
Is it possible to set actionbutton indicator colours from a qss stylesheet?

Please Log in or Create an account to join the conversation.

More
10 Mar 2020 00:04 #159614 by cmorley
Replied by cmorley on topic Action Button Indicator Colours
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
The following user(s) said Thank You: phillc54

Please Log in or Create an account to join the conversation.

  • phillc54
  • phillc54's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
10 Mar 2020 00:41 #159617 by phillc54
Replied by phillc54 on topic Action Button Indicator Colours

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 or Create an account to join the conversation.

More
10 Mar 2020 03:22 #159624 by cmorley
Replied by cmorley on topic Action Button Indicator Colours
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)
Indicated_PushButton{
qproperty-on_color: #000;
qproperty-off_color: #444;
}

Please Log in or Create an account to join the conversation.

  • phillc54
  • phillc54's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
10 Mar 2020 03:33 #159625 by phillc54
Replied by phillc54 on topic Action Button Indicator Colours

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)
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:
        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 or Create an account to join the conversation.

More
10 Mar 2020 03:39 #159626 by cmorley
Replied by cmorley on topic Action Button Indicator Colours
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 or Create an account to join the conversation.

  • phillc54
  • phillc54's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
10 Mar 2020 03:41 #159627 by phillc54
Replied by phillc54 on topic Action Button Indicator Colours

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 or Create an account to join the conversation.

More
10 Mar 2020 03:44 #159628 by cmorley
Replied by cmorley on topic Action Button Indicator Colours
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 or Create an account to join the conversation.

  • phillc54
  • phillc54's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
10 Mar 2020 03:47 #159629 by phillc54
Replied by phillc54 on topic Action Button Indicator Colours

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 or Create an account to join the conversation.

More
10 Mar 2020 03:52 #159630 by cmorley
Replied by cmorley on topic Action Button Indicator Colours
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 or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.073 seconds
Powered by Kunena Forum