more enum goodness
    Phil Thompson 
    phil at riverbankcomputing.com
       
    Thu Jul 14 10:04:14 BST 2022
    
    
  
On 14/07/2022 03:38, Kovid Goyal wrote:
> The stateChanged signal in PyQt6 delivers ints instead of 
> Qt.CheckState,
> which means the following breaks:
> 
> check_box.stateChange.connect(do_something)
> 
> def so_something(state):
>    if state == Qt.CheckState.Checked:
>       print('checked')
> 
> Instead one has to do:
> 
> def so_something(state):
>    if Qt.CheckState(state) == Qt.CheckState.Checked:
>       print('checked')
https://www.riverbankcomputing.com/pipermail/pyqt/2022-July/044778.html
Phil
    
    
More information about the PyQt
mailing list