How to uncheck the action on the toolbar
-
Hi all
I found the action could not be uncheck on the tool bar.
I setQActionGroup::setExclusive(true)
the put the actions into, then setQAction::setCheckable(true)
.the last action can be uncheck the last action when other actions checked, but it can not be uncheck if I press the same again.
Must I make a slot to
setchecked(false)
?Best regards
Mihan -
Hi all
I found the action could not be uncheck on the tool bar.
I setQActionGroup::setExclusive(true)
the put the actions into, then setQAction::setCheckable(true)
.the last action can be uncheck the last action when other actions checked, but it can not be uncheck if I press the same again.
Must I make a slot to
setchecked(false)
?Best regards
Mihan -
Hi @Mihan,
You should probably set exclusion policy to QActionGroup::ExclusionPolicy::ExclusiveOptional
actionGroup.setExclusionPolicy(QActionGroup::ExclusiveOptional)
-
@Gojir4 said in How to uncheck the action on the toolbar:
QActionGroup::ExclusionPolicy::ExclusiveOptional
Thanks a lot. it seems I must upgrade the Qt to 5.14
So does it meen I mustsetChecked(false)
by myself in lower version? -
M Mihan has marked this topic as solved on