Bool interprets "false" as "true"
-
i am getting my checkboxes filled like:
checkbox_1.setChecked(bool(feature["checkbox_1"]))and after they are getting checked/unchecked i save the changes with:
feature["checkbox_1"] = checkbox_1.isChecked()now the problem...
beforethe values from database are "x" for checked and "NULL" for unchecked. i should try to keep these values in the best case, but im not sure if and how this is possible.
afterchecked/unchecked the checkboxes their values from thesecond commandare "true" and "false". when i now uncheck one of the boxes thefirst commandinterprets "true" and "false" both as "checked" -
Hi,
It's up to you to "translate" these two non Boolean values to Boolean back and forth.
-
@qtnoob420 Is really not that hard:
checked = False if feature["checkbox_1"] == "x": checked = TrueOr shorter:
checked = feature["checkbox_1"] == "x" -
@qtnoob420 Is really not that hard:
checked = False if feature["checkbox_1"] == "x": checked = TrueOr shorter:
checked = feature["checkbox_1"] == "x"