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

Showing usecase outcomes in the UI

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:

  1. Exposing the list to QML.
  2. Binding ...

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