I have something like the following design of classes and I'm wondering if it's OK that I use many signal slot connections to communicate between them. There is a MainWindow
class which holds all the GUI, then a Wrapper
class, which provides an interface to the back-end, then there is a Controller
class for spawning and managing threads and finally there are Worker
s which do all the work.
Now let's say I'm loading a file and want to display progress using a progress bar in the MainWindow
. My Worker
class sends updateProgress(int progress)
to Controller::handleProgress(int progress)
slot which again sends progress signal to the Wrapper
class, which in return sends a progress signal to the main window, which finally updates the progress bar.
Similarly when the data has been loaded it is processed in the Wrapper
class and, again, communicated through signals and slots (although with one less step).
Is it a standard way of doing things in Qt or should I rethink my design?