O'Reilly logo

Hands-On Embedded Programming with Qt by John Werner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a more flexible display using layouts

When I first started working with Qt, I would run into the previous problem almost all of the time. When the size of the window changed, everything would break. Things would not be centered or they would go off the screen. Then, I learned about Qt layouts.

In Qt, a layout is flexible way of arranging items onscreen that allows you to specify locations in terms of the size of the containing item. There are several basic types of layouts:

Layout Description
 Vertical  Arranges widgets vertically
 Horizontal  Arranges widgets horizontally
 Grid  Arranges widgets in a grid
 Form Creates a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required