Qt notes (ten) Qt radio button slot function and implementation
I feel that the writing is not good, but I am not very familiar with how to write the slot function of python QT. More elegant writing will be added later.
self.ui.radioLeftButton.toggled.connect(lambda : self.onChangeOperationSide(self.ui.radioLeftButton))
self.ui.radioRightButton.toggled.connect(lambda : self.onChangeOperationSide(self.ui.radioRightButton))
def onChangeOperationSide(self, btn):
if btn.isChecked() == True:
# print(btn)
if btn.name == "radioLeftButton":
self._OperationSide = "Left"
# print("operation side changed to left")
if btn.name == "radioRightButton":
self._OperationSide = "Right"
# print("operation side changed to right")