<div dir="ltr">The QCheckBox.stateChanged() signal [1] is documented to include the state as an integer. Since QtCore.Qt.CheckState is now an enum.Enum it can not be compared against the integer value received with the signal. I like the type safety that comes with using enum.Enum and the stateChanged() signal is documented to take an integer, but it makes handling the signal more difficult than it should be.<div><br></div><div>There seem to be a few different ways that developers can work around this.</div><div><br></div><div> - Convert the integer QtCore.Qt.CheckState(newState)</div><div> - Compare the integer against the enum's value property QtCore.Qt.CheckState.Checked.value</div><div><br></div><div>Is there a better way to handle this? I have attached an example that should run with PyQt5 and PyQt6.</div><div><br></div><div>Regards,</div><div>Aron</div><div><br><div><br></div><div>[1] <a href="https://doc.qt.io/qt-6/qcheckbox.html#stateChanged">https://doc.qt.io/qt-6/qcheckbox.html#stateChanged</a><br></div></div></div>