1 Attachment(s)
Add QMenuBar into QWidget
Hi,
I'm trying to add a QMenuBar in a QWidget but I m lost in a step, I tell you all the work done for the moment:
I've create a layout in the QWidget called MenuBar
I promote the layout to QMenuBar and associate this layout to a classe: menuBar.cpp (with header menuBar.h)
I create those classes.
What's next?
PD: I have attached an image which I hope it will help....
Re: Add QMenuBar into QWidget
Why don't you use a QMainWindow?
QMenuBar is designed to be used within it.
Re: Add QMenuBar into QWidget
At the beginning of the project, the bar wasn't necessary, but now they told me to do it. So I have a QWidget with all the project in.
Re: Add QMenuBar into QWidget
Create a QMainWindow and use your QWidget as centralWidget.
Re: Add QMenuBar into QWidget
Like mcosta said, using QMainWindow is a good choice.
But if you insisting using QWidget to add menu bar, this post may be helpful to you: Qt QWidget add menu bar