Create a QActionGroup and let it be the parent of your actions. This QActionGroup will support the state of its children.
QActionGroup *anActionGroup = new QActionGroup(yourParentWidget); QAction* action1 = new QAction("Action 1", anActionGroup); QAction* action2 = new QAction("Action 2", anActionGroup); QAction* actionN = new QAction("Action N", anActionGroup); action1->setCheckable(true); action2->setCheckable(true); actionN->setCheckable(true);
mmonem
source share