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

Creating the characters entity

We will now go ahead and create a new entity called Characters to be added to entities.pri. Since this entity will be a subclass of a QAbstractListModel, we can use one of Qt Creator's file templates to create it. We will open entities.pri and use Qt Creator's New File or Project... menu. In the template selector, we will choose the Qt Item Model template under the Qt submenu. We'll want to define the following options in the wizard, ensuring that QAbstractListModel is selected as the base class:

Then, in the Project Management step, choose entities.pri as the project to be added to.

The newly created header ...

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