How to get the integer value of a checkBox
Solved
Qt for Python
-
wrote on 4 Oct 2022, 10:48 last edited by LT-K101 10 Apr 2022, 11:11
I want to get the int value when I check the checkBox, the result I get is a 0 instead of 1. Below is what I did please I need assistance.
can_add = int(self.ui.manageemp_canAdd_checkBox.isChecked()) print(can_add)
-
I want to get the int value when I check the checkBox, the result I get is a 0 instead of 1. Below is what I did please I need assistance.
can_add = int(self.ui.manageemp_canAdd_checkBox.isChecked()) print(can_add)
-
@LT-K101
This code should be returning the correct value, so if it returns0
that checkbox is not checked. Check where you are calling it from, and which checkbox it refers to.
1/3