I'm trying to create a list of button attributes that will be be used by QPushButton in a loop. I might have 16 buttons in the end and I don't want to list them all out by hand.
Text label and tooltips are easy, but I need to store the name of the button press code for each of the buttons and I haven't been able to get it to work.
Is it possible to make a list of functions that are contained within a simpleWindow class? Or am I doing it wrong, which is what I expect.
To use my code as an example. In my simpleWindows class I have some buttons defined:
Button_Name.append('DAC++') Button_Desc.append('Increment DAC output by 4.') Button_Call.append(self.on_UpButton_click) Button_Name.append('DAC--') Button_Desc.append('Decrement DAC output by 4.') Button_Call.append(self.on_DnButton_click)
The goal of Button_Call is to contain the name / address of the def that is called by the button when it is pressed.…