How to put pushbutton inside the QMenu or QAction control?

前端 未结 2 1149
南笙
南笙 2021-01-18 04:01

I need to put a QPushButton inside a QMenu. Is it possible and, if so, then how?

I want to achieve something like this:

2条回答
  •  无人及你
    2021-01-18 04:37

    If you only want a menu item to have a state, you may use Checkable property of QAction:

    rotateAct = new QAction(QIcon(":/images/Mouse/Rotate.png"), tr("&Rotate"), this);
    rotateAct->setCheckable(true);
    

提交回复
热议问题