Suprising enum difference in PyQt 6 from PyQt 5

Greg Couch gregc at cgl.ucsf.edu
Wed Apr 13 03:02:19 BST 2022


So I have a QTreeWidgetItem, and in PyQt 5, I was able to use:

> if item.checkState(0):
to check if the item was checked or not.  The return value is a 
QtCore.Qt.CheckState enum.   That fails in PyQt 6 because 
QtCore.Qt.CheckState.Unchecked evaluates as True.  If 
QtCore.Qt.CheckState were changed to subclass from enum.IntEnum, instead 
of enum.Enum, this would not be a porting problem.

     -- Greg



More information about the PyQt mailing list