Solved How to create custom menu
-
Hello Everyone,
I want to create a well designed menu in qt widget, I have found various links in which they are explaining like how we can create menus using qmenubar, But that will not help me to design my menu bar.
My menu will look some thing like this "https://prnt.sc/myat23". There will be several sub-menus between them.
Can any one help me to design the menus some thing like on the screenshot.Also,How we can embed 2 ui file and show into third file.
Thanks
-
Hi and welcome to the forums.
You can maybe find inspiration in this one.
https://github.com/chrisaverage/burger-menuRegarding UI files.
Creator can create 2 kinds.
One is just the UI file. There is no .h and .cpp created for it.
Those you can use via https://doc.qt.io/qt-5/quiloader.html
The other kind of UI files it can create, has .h and .cpp file also and a class that uses
the UI. This you can embed using the promotion feature
https://doc.qt.io/qt-5/designer-using-custom-widgets.html
It's not as complicated it might look like.
Say you made a class called MyMenu
you would simply tell it class name MyMenu and MyMenu.h
(in which file to find class)
Then click, add and then promote.