PDA

View Full Version : Can't check the action when it has a menu?



koilin
11th July 2012, 03:42
QMenu *menu = new QMenu;
QMenu *subMenu = new QMenu;
for (int i = 0; i < 6; i++)
{
QAction *action = new QAction(0);
action->setCheckable(true);
if (i == 3)
{
action->setMenu(subMenu);
}
menu->addAction(action);
}

The action in the menu has a sub menu, when you active this action, only show the sub menu, but can't be checked, why?

koilin
13th July 2012, 03:53
I am already have an idea, to reimplement the timerEvent.