I am wondering if there is a way to add a QWidgetAction to QMainwindow-> QMenuBar-> QMenu using qtcreator or qtdesigner.
I can add a widget through this code:
QWidgetAction *act = new QWidgetAction(ui->myMenu);
QLineEdit* edt = new QLineEdit("I am Line edit",ui->myMenu);
act->setDefaultWidget(edt);
ui->myMenu->addAction(act);
It compiles and works as expected.
However, I cannot achieve the same behavior with ui designer - it allows me to add QAction and QMenu classes as part of QMenuBar / QMenu and does not allow the promotion of QAction in QWidgetAction. Is there a way to add a QWidgetAction and the widget associated with it through the constructor, to use them as part of the Ui namespace and their properties editable with the ui editor?