QMainWindow to QWidget
-
@VJain85 said in QMainWindow to QWidget:
WinMain
Simply inherit QWidget instead of QMainWindow in WinMain
-
But if you want it to have toolbar and menus, why you then want it as a QWidget ????
Also can you explain the use case since QMainWindow is already a QWidget and can be used as a QWidget
in any/most regards, like inserting into dialogs etc.So Why do you need this ?
A project can have many MainWindows if you like. It does not matter.
You can use it as a widget while being of type QMainWindow. -
Ok so all the icon code in current MainWindow need to move to another class and
that is why you want to convert the base to plain QWidget ?Else I would just ignore that its of type QMainWindow and rename it to
something else and just use it like any other QWidget. -
Which of the options ?
-
Remove all icon and non compiling code
That is simply just to do it. Manually.
Maybe its easier to take the code you want for widget and put in new QWidget and then trow out the MainWin -
Use it as QWidget ?
Just do it. Its also a Qwidget besides a QMainWin so its just to do it.
-
-
-
Ok that sounds exciting. And slightly big project :) good luck.
Just as a note, a friend of mine made this great library
https://forum.qt.io/topic/104100/diagram-schematic-components-library
if you need inspiration/just to check out.