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

use case implementation

Going through the preceding use case steps should provide us with enough hints about the course of the use case and entity implementations, including:

  • Adding an item to the list by its name
  • Allowing us to check whether it is in the list or not
  • Allowing us to check the list is still ordered alphabetically by name

To achieve this, we first need to implement the API for usecases::AddGroceryItem, and then extend entities::GroceryItems.

The use case's structure will be very similar to that of usecases::CheckAvailableGroceries:

// add_grocery_item.h#ifndef ADD_GROCERY_ITEM_H#define ADD_GROCERY_ITEM_H#include <QObject>namespace entities {    class GroceryItems;}namespace usecases {class AddGroceryItem : public QObject

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