You have to QWidgetAction subclass of QWidgetAction and then just call addAction in your menu.
Sample code for Spin Box Action with label
class SpinBoxAction : public QWidgetAction { public: SpinBoxAction (const QString& title) : QWidgetAction (NULL) { QWidget* pWidget = new QWidget (NULL); QHBoxLayout* pLayout = new QHBoxLayout(); QLabel* pLabel = new QLabel (title);
Now just create it and add it to your menu
SpinBoxAction * spinBoxAction = new SpinBoxAction(tr("Action Title"));
pnezis
source share