- Posts: 5712
- Thank you received: 0
QRadioButtons in preferences file
6 years 3 weeks ago #185341
by phillc54
QRadioButtons in preferences file was created by phillc54
I am not sure of the correct way to handle QRadioButtons in the preferences file.
I have three QRadioButtons in a frame and it seems I need to load/save each of the QRadioButtons, is there a way to load/save only the QRadioButton that is checked. I tried testing the state of each QRadioButton when readin the preferences file but it still created an entry for all the QRadioButtons.
I have three QRadioButtons in a frame and it seems I need to load/save each of the QRadioButtons, is there a way to load/save only the QRadioButton that is checked. I tried testing the state of each QRadioButton when readin the preferences file but it still created an entry for all the QRadioButtons.
Please Log in to join the conversation.
6 years 3 weeks ago #185343
by cmorley
Replied by cmorley on topic QRadioButtons in preferences file
In Designer:
connect all the radio buttons to form slot using the signal 'toggled(bool)' and manually add the arbitrary named slot 'radio_toggled'
linuxcnc.org/docs/2.8/html/gui/qtvcp.html#cha:designer-slots
In the handler file add :
Noe every time the radio button group changes, the radiobutton that is true is recorded in the preference file unde the arbritrary heading 'CUSTOM_FORM_ENTRIES'
It will also set the button true on start up - note that the default radiobutton name must be correct or the first time run it will error.
connect all the radio buttons to form slot using the signal 'toggled(bool)' and manually add the arbitrary named slot 'radio_toggled'
linuxcnc.org/docs/2.8/html/gui/qtvcp.html#cha:designer-slots
In the handler file add :
Code:
# at this point:
# the widgets are instantiated.
# the HAL pins are built but HAL is not set ready
def initialized__(self):
rb = self.w.PREFS_.getpref('RADIOGROUP1', 'default_radiobutton_object_name', str, 'CUSTOM_FORM_ENTRIES')
self.w[rb].setChecked(True)
Code:
#######################
# callbacks from form #
#######################
def radio_toggled(self, data):
if data:
name = self.w.sender().text()
print (name)
if self.w.PREFS_:
self.w.PREFS_.putpref('RADIOGROUP1', self.w.sender().objectName(),str, 'CUSTOM_FORM_ENTRIES')
Noe every time the radio button group changes, the radiobutton that is true is recorded in the preference file unde the arbritrary heading 'CUSTOM_FORM_ENTRIES'
It will also set the button true on start up - note that the default radiobutton name must be correct or the first time run it will error.
Please Log in to join the conversation.
6 years 3 weeks ago #185344
by phillc54
Replied by phillc54 on topic QRadioButtons in preferences file
Great, thank you again...
I'll try to go a whole day without bugging you.
I'll try to go a whole day without bugging you.
Please Log in to join the conversation.
6 years 3 weeks ago #185346
by cmorley
Replied by cmorley on topic QRadioButtons in preferences file
All Good.
Give us a peak at what ur doing - I'm curious....
Give us a peak at what ur doing - I'm curious....
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
6 years 3 weeks ago #185347
by tommylight
bit my nails to the bone waiting here !
Replied by tommylight on topic QRadioButtons in preferences file
+1cmorley wrote: All Good.
Give us a peak at what ur doing - I'm curious....
bit my nails to the bone waiting here !
Please Log in to join the conversation.
6 years 3 weeks ago #185348
by phillc54
forum.linuxcnc.org/qtpyvcp/40082-monokro...-mill?start=0#182773
It is being done in master branch with python3. I almost have the main screen layout completed, I'll post the .ui .qss and handler file tomorrow. Still got a LONG way to go.
Replied by phillc54 on topic QRadioButtons in preferences file
I am doing a screen based on pinders theme:cmorley wrote: All Good.
Give us a peak at what ur doing - I'm curious....
forum.linuxcnc.org/qtpyvcp/40082-monokro...-mill?start=0#182773
It is being done in master branch with python3. I almost have the main screen layout completed, I'll post the .ui .qss and handler file tomorrow. Still got a LONG way to go.
Please Log in to join the conversation.
6 years 3 weeks ago #185435
by phillc54
Replied by phillc54 on topic QRadioButtons in preferences file
Here you go...
It is a zip file of the complete working config. A bit lazy I know but it is the easiest way for me to keep everything in one place. The Qtvcp file are all in the qtplasmac subdirectory if you want to break them out.
I think I squeezed all I can into 1024x768 but it is resizable.
I actually started this as an experiment with a copy of QtDragon so you will see there is a lot of extraneous stuff in the handler that we don't need for plasma that I will remove. I thought about starting a fresh handler file but I have too much time invested in this now to not warrant that.
It is a zip file of the complete working config. A bit lazy I know but it is the easiest way for me to keep everything in one place. The Qtvcp file are all in the qtplasmac subdirectory if you want to break them out.
I think I squeezed all I can into 1024x768 but it is resizable.
I actually started this as an experiment with a copy of QtDragon so you will see there is a lot of extraneous stuff in the handler that we don't need for plasma that I will remove. I thought about starting a fresh handler file but I have too much time invested in this now to not warrant that.
Please Log in to join the conversation.
6 years 3 weeks ago #185439
by cmorley
Replied by cmorley on topic QRadioButtons in preferences file
It amazes me how quickly you can get up to speed with others code and create some great stuff!
I added a pic so others can get a glimpse - hope you don't mind.
I added a pic so others can get a glimpse - hope you don't mind.
Please Log in to join the conversation.
6 years 3 weeks ago #185442
by phillc54
Replied by phillc54 on topic QRadioButtons in preferences file
No, not a problem.
It is interesting that the progress bar displays as odd colors in your pic, it displays correctly here. Could that have something to do with display drivers. I run mine on a VMWare virtual machine on a mac.
It is interesting that the progress bar displays as odd colors in your pic, it displays correctly here. Could that have something to do with display drivers. I run mine on a VMWare virtual machine on a mac.
Warning: Spoiler!
Attachment not found
Please Log in to join the conversation.
6 years 3 weeks ago #185598
by rodw
What casues this error when giving this a go?
Replied by rodw on topic QRadioButtons in preferences file
phillc54 wrote: Here you go...
It is a zip file of the complete working config. A bit lazy I know but it is the easiest way for me to keep everything in one place. The Qtvcp
What casues this error when giving this a go?
Code:
Machine configuration directory is '/home/rod/linuxcnc/configs/qtplasmac/qtplasmac'
Machine configuration file is 'qtplasmac.ini'
can't find package Linuxcnc
while executing
"package require Linuxcnc "
(file "/home/rod/linuxcnc-plasmac/lib/hallib/check_config.tcl" line 160)
check_config validation failed
LinuxCNC terminated with an error. You can find more information in the log:
Please Log in to join the conversation.
Time to create page: 0.155 seconds
