Qt Code:
  1. QMenu *menu = new QMenu;
  2. QMenu *subMenu = new QMenu;
  3. for (int i = 0; i < 6; i++)
  4. {
  5. QAction *action = new QAction(0);
  6. action->setCheckable(true);
  7. if (i == 3)
  8. {
  9. action->setMenu(subMenu);
  10. }
  11. menu->addAction(action);
  12. }
To copy to clipboard, switch view to plain text mode 

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?