Managing the widget layout with layouts
Qt Widgets includes a robust layout system to control the presentation of widgets on the display. In Qt Creator Designer, you can pick from the following layouts:
QBoxLayout
: This lays out its view children horizontally or verticallyQHBoxLayout
: This lays out its view children horizontallyQVBoxLayout
: This lays out its view children verticallyQFormLayout
: This lays out pairs of widgets (such as labels and textboxes) side by side and then tiles those pairs vertically, giving the appearance of a formQGridLayout
: This lays out widgets in a gridQStackedLayout
: This shows only a single widget at a time
Using one of these layouts is easy: simply choose the appropriate layout in Qt Creator Designer and drag it to ...
Get Application Development with Qt Creator - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.