MainWindow inside MainWindow
Unsolved
General and Desktop
-
Hey guys. How can i put a Mainwindows inside a Mainwindow. Is this possible?
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); QMainWindow *mainWindow = new QMainWindow; QMainWindow *subWindow = new QMainWindow(mainWindow); mainWindow->setCentralWidget(subWindow); subWindow->setWindowFlags(Qt::Widget); mainWindow->show(); return a.exec(); }
-
@thomasGl said in MainWindow inside MainWindow:
Hey guys. How can i put a Mainwindows inside a Mainwindow. Is this possible?
In general, yes, but why do you think you need it?
QMainWindow
is just aQWidget
class with some status bars and menus after all...
In most cases where people think they need twoQMainWindows
, a normalQWidget
or any other design is better/fine. -
Never seen a use case for that. And it’s risky business, especially when floating dock widgets come into play.