QT horizontal & vertical layout

Опубликовано: 05 Август 2026
на канале: Alaa Elockl
667
3

In this tutorial, we will learn Layouts of Qt. We will add layouts to a form and add widgets to the layout programmatically instead of using Designer as was done in the Layouts.

We will create an empty project and will create 6 PushButtons. Then, we will arrange 3 buttons with horizontal layout, and the other three with vertical layout. The two layouts will be added to the the outer most layout, and then we pass the outer layout to our widget using setLayout().