PDA

View Full Version : QCheckbox - how to set next state after clicking "partially checked"?



FelixB
1st March 2012, 13:32
Hi all,

I have a QCheckbox with a "partially checked"-state. When clicked, it sets "checked"-state. But I want to set "unchecked" instead. How to do that?

thanks in advance!
Felix

Urthas
2nd March 2012, 02:52
Have you tried connecting QCheckbox::stateChanged() to a custom slot that tests QCheckbox::checkState() and sets to unchecked as appropriate?

FelixB
2nd March 2012, 07:55
in the meantine, yes. But I don't use checkState(), instead I check if the condition for "partially checked" is still true - in my case: not all elements of a group are selected. If so, I set the state to "unchecked" before proceeding the rest of the checkState()-method.