When you click a checkable button. The checkstate always inverts:
on to off
off to on
This is because when a checkable button is clicked Qt calls the nextcheckstate function.
QAbstractButton::nextCheckState()
Is there a way to avoid that? (I would like to decide check state by myself)
In my mind I would have to do the following steps to avoid that:
Does somebody know which function to override?
Try:
Checkablebutton->blockSignals(true); // Maybe nextCheckState() is not call from now on until BlockSingls(false)
//some code
Checkablebutton->blockSignals(false);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.