How to convert a QWidget into a QMainWindow
Hi, I created a QWidget with controls in it. But now I need to put a menu into it, but how to convert it to a QMainWindow easily, without creating another form and paste the controls into it?
I tried to modify the ui file and changed the QWidget to QMainWindow, but the Designer complained when it open the file.
Thanks.
Re: How to convert a QWidget into a QMainWindow
You don't need to convert your QWidget into a QMainWindow.
You can create a new QMainWindow and use it's setCentralWidget() member function to make your widget appear in the main window.
Re: How to convert a QWidget into a QMainWindow
Quote:
Originally Posted by
Zlatomir
You don't need to convert your QWidget into a QMainWindow.
You can create a new QMainWindow and use it's
setCentralWidget() member function to make your widget appear in the main window.
Thanks, but I would like everything to be in one file, since they are all related.
Nice to know this tip though, will be using it one day.