Freenove / Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi

Apply to FNK0043
Other
133 stars 148 forks source link

Main.py fails to use the QT `toggle()` method #53

Open fire-eggs opened 5 months ago

fire-eggs commented 5 months ago

In Main.py, lines 250-289, the code fails to use the toggle() method. In other words, eight instances of code similar to this:

            if self.checkBox_Led1.isChecked() == True:
                self.checkBox_Led1.setChecked(False)
            else:
                self.checkBox_Led1.setChecked(True)

can be replaced by corresponding simplified code:

            self.checkBox_Led1.toggle()