Regardless if i is 0 or 1 you always set the state Qt::Checked! Use Qt::Unchecked for the else scope.
The Qt::Checked state is being set on two different controls. If they are in a QButtonGroup then they might be automatically exclusive. This would usually be done with QRadioButton or a single QCheckBox though.
Bookmarks