Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
29 May 2024
In this second episode on layout managers, we will discuss how to make widgets stretch, and how to get spaces into your layout.
We will discuss that both when you code it in C++, and when you do it in Qt Designer.
0:00 Intro
0:49 How layout managers and widgets communicate
3:25 sizeHint() and minumumSizeHint()
6:17 How to force a specific size on a widget
9:36 Stretching widgets
12:44 Stretching in Qt Designer
15:48 The alternative way to specify stretch factor in Qt Designer
18:24 KDAB trainings
18:42 Adding spaces around the layout managers
19:42 Size policies
Links:
* Understanding Contents Margins in Qt Layouts: https://youtu.be/D5nsjsPbEJc?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tree/master/Programming-With-Qt-Widgets
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
All Introduction to Qt Widgets videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6iFcTyItvnE5nOmJR8qk_7o
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Upgrade your applications from Qt 5 to Qt 6 with KDAB’s migration services. Get a free migration assessment and join a hands-on workshop to prepare your team for a successful transition!
Learn more