What should happen if, after instructing the application to run the usecase, this ends successfully?
Let's say we want to print the list of grocery items, each item displaying its name. We achieve this by:
- Creating an object that handles text output
- Creating a slot that writes the list to the text output
- Connecting the usecase's success signal to the slot
For the text output object, we use the convenient QTextStream (http://doc.qt.io/qt-5.9/qtextstream.html) class and connect it with the console's stdout device:
// tui/main.cpp...QTextStream cout(stdout);...
For the slot, we can make use of a C++11 lambda, which can be defined directly as the third argument to connect: