Introduction to Qt / QML (Part 37) - Qt Quick Layouts
So far we have seen various techniques for automatically place and/or resize elements in Qt Quick: manual positioning, anchors, positioners. If you need to do a quick catch-up for those, please go watch the related videos earlier in series!
It is now time to discuss yet another one – perhaps, the most powerful: Qt Quick Layouts. Layouts act like positioners: they automatically arrange their children according to a criterion (e.g. lay elements out vertically, horizontally, in a grid). Unlike positioners, layouts are also able to resize elements, and offer a much richer API when it comes to controlling sizing. (It's not the first time that we discuss sizing: we have already seen implicit sizing in this video https://youtu.be/Lt-8fYWOVx8).
As usual, GammaRay can help you understand and debug item layouting. You can freely download GammaRay from GitHub: https://github.com/KDAB/GammaRay/wiki/Getting-GammaRay
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.
About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more. https://www.kdab.com/software-services
KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.
Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/
We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/
253