O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

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

Time for action – Applying layouts to the items

Before we apply layouts to objects, remove the anchors we had created. To do this, select each element and click on the buttons under Anchors text to uncheck them. The anchor properties below the buttons will disappear. The layout will now be able to position the objects.

First, import the QtQuick.Layouts 1.3 module into the form, like we did earlier for QtQuick.Controls. Locate the Qt Quick - Layouts section in the palette and examine the available layouts:

  • Column Layout will arrange its children vertically
  • Row Layout will arrange its children horizontally
  • Grid Layout will arrange its children vertically and horizontally in a grid
  • Stack Layout will display only one of its children and hide ...

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