O'Reilly logo

Qt 5 Projects by Marco Piccolino

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

Adding the main layout

The first thing that we want to do is to define the main layout for our window, which will contain the characters list and other controls on the left and the text editor on the right. We can lay out the widgets into two columns with a Horizontal Layout (http://doc.qt.io/qt-5.9/qhboxlayout.html). We will thus drag the Horizontal Layout component into the canvas. A new node called horizontalLayout is created in the object tree on the right side of the window, as a child to centralWidget. To have the layout take up all available space in the window, we need to right-click on MainWindow and select Lay Out... > Lay Out in a grid. In the canvas, we will see that the red rectangle representing the child layout now spans the ...

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