We now have to create the
Task class that will hold our data (task name and completed status). This class will have its form file separated from
MainWindow. Qt Creator provides an automatic tool to generate a base class and the associated form.
Click on File | New File or Project | Qt | Qt Designer Form Class. There are several form templates; you will recognize Main Window, which Qt Creator created for us when we started the
todo app project. Select Widget and name the class
Task, then click on Next. Here is a summary of what Qt Creator will do:
- Create a
Task.hfile and a
- Create the associated
Task.uiand do the plumbing to connect it to
- Add these three new files to
todo.proso they can be compiled.
Finish and, ...