Time for action – Adding a layout to the form

Select the MainWindow top-level item in the object tree and click on , the Lay Out Vertically icon in the upper toolbar. The button, labels, and the empty widget will be automatically resized to take all the available space of the form in the central area:

If the items were arranged in a different order, you can drag and drop them to change the order.

Run the application and check that the window's contents are automatically positioned and resized to use all the available space when the window is ...

Get Game Programming using Qt 5 Beginner's Guide - 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.