I understand setCentralWidget is required in QMainWindow implementation, and at first sight, it seemed extremely self-explaining what central widget means.
Usually you don't need a QMainWindow
!
If you don't need docking nor MDI, then don't use QMainWindow
: a QWidget
or a QDialog
will do instead.
Central means "in the center", as in "in the middle", not as in "important!". QMainWindow
's provides docking and multiple document interface (MDI) functionality, and there the notion of a central widget is useful. There can only be one central widget, so "which of many" should be made central is moot: you can't have more than one. One of the fundamental aspects of Qt object design is that QObject
is a container of other objects, and so is a QWidget
: it's a canvas that you can place other widgets on. So, if you absolutely need docking and/or MDI, then the central widget will be any QWidget
that you put other non-docking widgets on. That' all.