Is there a way to add a QWidget to a QMenu in QtCreator

后端 未结 3 2150
小蘑菇
小蘑菇 2021-02-14 04:02

I\'m creating a text editor and I\'d like to put the QComboBox in the QMenu. I didn\'t find any method inside the QMenu that handled such

3条回答
  •  不知归路
    2021-02-14 04:28

    QWidgetAction is a QAction that contains a QWidget. You can use this to encapsulate your QComboBox and add it to your menu via QMenu::addAction.

提交回复
热议问题