QWidgetAction is what you are looking for. This is what is on qt docs
The QWidgetAction class extends the QAction interface for inserting custom widgets into containers based on actions
So basically this gives the user interface for QAction according to what QWidget you pass to it. I used QWidgetAction to show the checkbox as QMenu elements.
QCheckBox *chkBox = new QCheckBox(menu); chkBox ->setText("MyCheckBox"); QWidgetAction *chkBoxAction= new QWidgetAction(menu); chkBoxAction->setDefaultWidget(chkBox); menu->addAction(chkBoxAction);
Then you can process the signals from the checkbox.
source share