We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbfa3ff commit a7460cbCopy full SHA for a7460cb
03-QtWidgets-常用控件/02-Button-按钮控件/04-QCheckBox-复选框/03-QCheckBox-信号.py
@@ -30,11 +30,11 @@ def test_01(self) -> None:
30
31
@QtCore.Slot(int)
32
def test_slot(state: int) -> None:
33
- if state == Qt.Checked:
+ if state == Qt.Checked.value:
34
print("复选框被选中了!")
35
- elif state == Qt.Unchecked:
+ elif state == Qt.Unchecked.value:
36
print("复选框被取消选中了!")
37
- elif state == Qt.PartiallyChecked:
+ elif state == Qt.PartiallyChecked.value:
38
print("复选框被部分选中!")
39
40
self.cb.stateChanged.connect(test_slot) # type: ignore
0 commit comments