There is still one bit missing before we can appreciate the fruit of our labor: how shall we display the outcomes of our usecases? We know that the only entity involved so far is GroceryItems, which wraps a list. We exposed this entity from C++ to QML via a context property as groceryItems. We now want to use this list as the data model for groceriesListView. Then, if all goes well, running our use cases will produce changes in groceriesListView: and its items will be listed (use case CheckAvailableGroceries), added (use case AddGroceryItem), or removed (use case RemoveGroceryItem).
Displaying the contents of the groceryItems list in groceriesListView requires two steps:
- Exposing the list to QML.
- Binding ...