O'Reilly logo

Learn Qt 5 by Nicholas Sherriff

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 clients

Let’s put our new infrastructure to use and wire up the CreateClientView. If you remember, we present a save command that when clicked on, calls onCreateClientSaveExecuted() on CommandController. In order to be able to perform anything useful, CommandController needs visibility of the client instance to be serialized and saved, and an implementation of the IDatabaseController interface to perform the create operation for us.

Inject them into the constructor in command-controller.h, including any necessary headers:

explicit CommandController(QObject* _parent = nullptr, IDatabaseController* databaseController = nullptr, models::Client* newClient = nullptr);

As we’ve seen a few times now, add the member variables to Implementation ...

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