pyqt designer and layout for central widget

Question:

I started new clear Main Window project,

There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar.

I need to set default layout inside the window, so probably for centralWidget.

But I didnt found way how to do it.
I can get LayoutWidget with some particular size into centralWidget.

But I want to set layout for the whole centralWidget.

Asked By: Meloun

||

Answers:

Add some widgets to the central widget first.

Then select the central widget and use the “Layout in a Grid”, “Layout Vertically”, etc buttons on the toolbar to add a main layout.

The layouts in the “Widget Box” side-bar are used for adding child layouts to a main layout.

Answered By: ekhumoro

Right click anywhere within your centralWidget go to the Lay Out sub menu and select the Layout you want. This will be applied automatically to all contents of your centralWidget.

In order to see how it works place inside it 2 or 3 push buttons and try changing the layouts.

Answered By: pnezis
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.