Unsolved can i donot setCentralWidget in QMainWindow?
-
can i donot setCentralWidget in QMainWindow?
and then i just add some dockWidget there. but without a CentralWidget.
is it safe to donnot set it? -
@opengpu Why?
-
Hi
Well docs says
"Note: Creating a main window without a central widget is not supported. You must have a central widget even if it is just a placeholder." -
@mrjj said in can i donot setCentralWidget in QMainWindow?:
placeholder
placeholder? simply setCentralWIdget(new QWidget())?
-
@opengpu
yes. -
QWidget* pCentralWidget = new QWidget(this); //pCentralWidget->setVisible(false); //which is better? //pCentralWidget->setFixedSize(QSize(0,0)); //which is better? setCentralWidget(pCentralWidget);
-
@mrjj //which is better?
-
Hi
well what do you try to do ?
i would say setVisible(false); if you try to hide it.Normally all other widgets live in CentralWidget
so its odd if you want to hide it. -
@mrjj i want all the Widgets are dockwidget
-
I would support a central widget by implementing drag-n-drop of docks into the center and vise versa.
-
@mrjj said in can i donot setCentralWidget in QMainWindow?:
Normally all other widgets live in CentralWidget
Normally all other widgets live in CentralWidget? but i think the DockWidget is in the MainWindow which is their parent.
-
@opengpu
Hi
Yes dockwidgets do live outside central. (around it)
I mean other widgets. But if you dont need it, i guess only docks are fine :)