Skip to content

Commit

Permalink
修正state判断错误,Qt.Checked.value才是int类型
Browse files Browse the repository at this point in the history
  • Loading branch information
sltlala authored and muziing committed Feb 3, 2024
1 parent dbfa3ff commit a7460cb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def test_01(self) -> None:

@QtCore.Slot(int)
def test_slot(state: int) -> None:
if state == Qt.Checked:
if state == Qt.Checked.value:
print("复选框被选中了!")
elif state == Qt.Unchecked:
elif state == Qt.Unchecked.value:
print("复选框被取消选中了!")
elif state == Qt.PartiallyChecked:
elif state == Qt.PartiallyChecked.value:
print("复选框被部分选中!")

self.cb.stateChanged.connect(test_slot) # type: ignore
Expand Down

0 comments on commit a7460cb

Please sign in to comment.