Use QAction (c++) in QML Menu
-
Hi,
I am adding a new view based in QML to an existing Qt(c++) project. In the original project I am using a list of QAction for adding a context menu to some QWidgets.
Is there a way for using the existing actions in a Menu object in QML? Basically I don't want to redo all the existing work in QML.
-
AFAIK, you need to use "QML action":http://qt-project.org/doc/qt-5/qml-qtquick-controls-action.html element. There was a plan to move QAction into QtGui in Qt 5, but it was not implemented in time, so now it has to wait for Qt 6.
-
Thanks for the answer, I wanted to be sure that there is no other way :)