Editing clients

With an existing client now located and loaded from the database, we need a mechanism to be able to view and edit the data. Let’s prepare by first creating the context commands we will use in the edit view. Repeat the steps we took for the Find Client View and in CommandController, add a new list of commands named editClientViewContextCommands, along with an accessor method and Q_PROPERTY.

Create a new slot to be called when the user saves their changes on the edit view:

void CommandController::onEditClientSaveExecuted()
{
    qDebug() << "You executed the Save command!";
}

Add a new save command to the list that calls the slot when executed:

Command* editClientSaveCommand = new Command( commandController, QChar( 0xf0c7 ), "Save" ...

Get Learn Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.