Adding a task

We will now rearrange the layout of MainWindow to be able to display our todo tasks. At this moment, there is no widget where we can display our tasks. Open the MainWindow.ui file. We will use Qt designer to create the UI:

  1. Drag and drop Horizontal layout inside the central widget and rename it toolbarLayout 
  2. Right-click on the central widget and select Lay out vertically
  3. Drag and drop the label, spacer, and button inside toolbarLayout 
  4. Drag and drop Vertical layout under toolbarLayout  (a blue helper line will be displayed) and rename it tasksLayout 
  5. Add a vertical spacer under tasksLayout  (again, check the blue helper line):

Voilà! Your MainWindow form is finished. Later in the chapter you will learn how to dynamically ...

Get Mastering Qt 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.