[PyQt] Can QCheckBox state be set without triggering stateChanged?

Eric Coetzee ericcoetzee at gmail.com
Tue Apr 20 20:24:44 BST 2010



On 20 Apr 2010, at 19:51, Doug Bell <dougb at bellz.org> wrote:

> Eric Coetzee wrote:
>> Hi,
>>
>> I have a situation where I want to set the state of a checkbox while
>> inside the method that handles the stateChanged event. But I don't
>> want QCheckBox.stateChanged(state) to be triggered again.
>>
>> Can this be done?
>
> Yes, just do:
>
>   checkbox.blockSignals(True)
>   checkbox.setChecked(...)
>   checkbox.blockSignals(False)
>
>
> Doug
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Sweet! Did not know about these methods.

Thanks Doug


More information about the PyQt mailing list