PDA

View Full Version : How do I style a checkable QAction in a QMenu???



remember
20th September 2017, 18:39
How do I style the box in a checkable QAction in a QMenu?

My checkable menu works but I cannot figure out how to change the look of the checkbox itself?

12588 I get this

12589 But I want this





QMenu* mySubmenu = addMenu(tr("MySubmenu"));
QAction *pAction;

pAction = new QAction("Option 1");
pAction->setCheckable(true);
pAction->setChecked(isChecked());
connect(pAction, &QAction::triggered, this, [=](bool checked) { onSubmenuClick(); } );
mySubmenu->addAction(pAction);

pAction = new QAction("Option 2");
pAction->setCheckable(true);
pAction->setChecked(isChecked());
connect(pAction, &QAction::triggered, this, [=](bool checked) { onSubmenuClick(); } );
mySubmenu->addAction(pAction);