dennisvz
26th April 2019, 18:58
If I have the following snippet of code (from a larger section):
if self.generator.MS == "S":
self.lockSpouseBoxes(True)
else:
self.lockSpouseBoxes(False)
def lockSpouseBoxes(self):
self.ui.lineEdit1.setEnabled(variable for True or False)
How do I modify either/both the top part and the bottom function to carry the True or False from the top part to the function (there will be many line edits to setEnabled true or false). Stated another way, if MS == "S", I want to set a bunch of line edits to "setEnabled(True)" and vice versa. I'm new and not quite sure how to phrase the question.
if self.generator.MS == "S":
self.lockSpouseBoxes(True)
else:
self.lockSpouseBoxes(False)
def lockSpouseBoxes(self):
self.ui.lineEdit1.setEnabled(variable for True or False)
How do I modify either/both the top part and the bottom function to carry the True or False from the top part to the function (there will be many line edits to setEnabled true or false). Stated another way, if MS == "S", I want to set a bunch of line edits to "setEnabled(True)" and vice versa. I'm new and not quite sure how to phrase the question.