* Assume “worker” is the instance of controller class. Then in the view class:
self.worker.showDialog.connect(self.showIntroWindow)
will connect the signal showDialog defined in worker such that when data is emited to showDialog, the method called showIntroWindow in the view class will be called.
Then in the worker (controller) class before any of the methods we define the signal:
showDialog = QtCore.pyqtSignal(object)
Note that the view class does not reference any methods in the controller class
Then when the controller class wants to change the view it does something like:
self.showDialog.emit(True)
And the view class will receive this in methodshowIntroWindow which will at that point be called.
showIntroWindow will receive the value as a parameter. Here is its definition:
def showIntroWindow(self, state):
So in our example, state = True