Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5.2 Qml support for Ubuntu Global Menu

I am creating a desktop application and I was wondering how I would go about having the Qt Quick Controls menubar show up as a global menu on Ubuntu?

like image 718
user2887117 Avatar asked Feb 21 '14 04:02

user2887117


1 Answers

If I understood well (from this post) you can't inject QML code in Ubuntu's (Unity) global menu (read: UGM).

But if you really want to your menu appear as UGM then my nasty workaround would be to create two windows, one which will represent UGM (set it to be on top of all windows) and another actual application. QtDesktop component should help you. However, I wouldn't recommend you to do this way because you need to look on many things (like actions when window looses focus).


If you don't want to inject QML code in UGM, but just to make your own menu which will trigger functions in QML, then follow these instructions. And later connect C++ code to QML.


Also, try creating menu with QtDesktop component first, it might move menu automatically to UGM. (I am not using Ubuntu, so I can't check this for you)

like image 71
DRAX Avatar answered Oct 15 '22 19:10

DRAX