0

Why Qt Designer create a general widget and then create GridLayout object child object ?

self.gridLayoutWidget = QWidget(self.centralwidget)
self.gridLayout = QGridLayout(self.gridLayoutWidget)

Can i directly create a child GridLayout object ?

self.main_layout = QtWidgets.QGridLayout(self.centralwidget)
floupinette
  • 150
  • 11
  • It must have been you that added the extra widget. Qt Designer always creates a default central-widget, and a grid-layout can easily be added directly to that (once some child widgets have been added first). So I don't see what the problem is. – ekhumoro May 16 '23 at 17:24
  • @floupinette If you want to set a main layout for a window, you must not add it from the widget box, but by right clicking on an empty area of that window. Read how to [use layouts in Designer](https://doc.qt.io/qt-6/designer-layouts.html) – musicamante May 16 '23 at 18:25

0 Answers0