[SOLVED] Embedded QMainWindow-deriven widget in application
-
-
This image may be more descriptive. See the widget on the right bottom:
-
I see, you want to embedding a instance of QMainWindow into a normal QWidget. In other words, you don't want to show it as a seperated window.
So just
@
mw->setWindowFlags(mw->windowFlags() & ~Qt::Window);
@Or, You even do not need QMainWindow for such a simple widget contains QMenuBar.
As QMenuBar, QToolBar and QStatusBar are subclass of QWidget, you can put them to a normal QWidget, the same as you put a QPushButton onto it.
-
[quote author="1+1=2" date="1338136412"]
Or, You even do not need QMainWindow for such a simple widget contains QMenuBar.As QMenuBar, QToolBar and QStatusBar are subclass of QWidget, you can put them to a normal QWidget, the same as you put a QPushButton onto it.
[/quote]Yes, but toolbars won't move around and they will loss their dockablity. Also that small context menu that allows us to choose which toolbar should be show, is no more available.
First solution looks more convenient but have problems. Size grip is still there. And trying to adjust size of embedded MW will resize whole application :-/
-
I think that "Size grip " will disappear if you didn't create a QStatusBar.