PDA

View Full Version : Can I change a QMenu to QAction in Qt Creator?



bobbayribs
4th December 2016, 22:58
Hi,

Within Qt Creator, I don't know how to change a QMenu object to a QAction object.

From my top menu bar, I would like one object to act as a button instead of a dropdown menu, since there are no submenus for this particular object.

Reading from various threads, I learned that I need to change my QMenu object to a QAction object.

I was able to manually edit ui_mainwindow.h and modify it and it works perfectly; but of course, whenever I rebuild from the GUI, I lose my changes.



QAction *actionSubmittal_Directory;
actionSubmittal_Directory = new QAction(MainWindow);
actionSubmittal_Directory->setObjectName(QString::fromUtf8("actionSubmittal_Directory"));

Any suggestions how to change this in the GUI creator itself?

12237

anda_skoa
5th December 2016, 09:20
I think Qt Designer can't place actions into the menu bar.
But you should be able to do that in code.

Cheers,
_