Create custom QMenubar
-
Hello I would like to create custom qmenubar.
It must to has qmenus and some buttons.

I tried demo with label but it is not what I would

in ui

MenuForm::MenuForm(QWidget *parent) : QMenuBar(parent) , ui(new Ui::MenuForm) { ui->setupUi(this); QMenu *menu1 = new QMenu("menut1"); addMenu(menu1); QMenu *menu2 = new QMenu("menut2"); addMenu(menu2); }How could i create like i draw?
-
Hi,
QWidgetAction comes to mind for that.
-
Thank you for reply.
I want to be sure I understood correctly. Could I ask a few questions for that?
Question 1: Should I use QWidgetAction instead of QMenuBar?
Question 2: In the scenario where I continue to use QMenuBar, should I add QWidgetAction to QMenuBar?
Question 3: In the scenario where I use QWidgetAction, should I add QMenus to QWidgetAction?
Question 4: In the scenario where I use QWidgetAction, is there a way to edit visually through the UI file, or will these adding and editing operations be done entirely through code? Because editing visually is always better than editing with code (for GUI). -
- No
- Yes
- No
- I don't know and I disagree with you. Editing visually is just one way to do it. It's not better or worse than doing it 100% in code. It's a matter of personal taste and skills. Some people need or like to use Designer while other can go perfectly well without it.
-
J Joe von Habsburg has marked this topic as solved