The Qt::stateChanged signal is currently emitted with a value of type integer, even though the signal documentation says that the state parameter "contains the checkbox's new Qt::CheckState." It seems like this signal should be emitted with a value of type Qt::CheckState instead. The two spots where this signal is emitted in qcheckbox.cpp, it's emitted with a Qt::CheckState value that's implicitly converted to an integer. For comparison, the QScroller::stateChanged signal, which is similar to QCheckBox::stateChanged, is emitted with a QScroller::State value rather than an integer.
The integer parameter of QCheckBox::stateChanged is particularly problematic when working with PyQt 6, because PyQt 6 enforces type checking for enums, which means that integers will never compare equal to any Qt::CheckState value. In other words, if the following slot is connected to QCheckBox::stateChanged in PyQt 6
then it will always print "Unrecognized value" because it will be called with 0, 1, or 2, instead of Checked, Unchecked, or PartiallyChecked. To work around this, comparisons need to be done against, e.g. Qt.CheckState.Checked.value (the ".value" at the end will convert the enum into an integer) instead.