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

Triggering usecases from the UI

Moving to the UI code, we would want the usecases to be triggered when specific user-generated or system-generated events happen. Specifically, in the following UI, we would like to:

  • Trigger usecases::CheckAvailableGroceries::run as soon as the page which displays the list of grocery items appears, so that we see a full list instead of an empty one
  • Trigger usecases::AddGroceryItem::run whenever the user enters an item type in the text field and presses the Add item button
  • Trigger usecases::RemoveGroceryItem::run whenever the user presses the X button next to a list entry:

We have already exposed the use case ...

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