It is fine to create your gui instance (XDialog) in global, but instead you might want to put the launching code in main() right away, in case you would like to make a package in the future (see here). Also, you shouldn't put your signal in empty class (MySignal and MySignal2), they should be declared into your worker thread (MyTCPHandler), which should be a QObject. Init the object from your gui loop and connect the signals directly:
self.tcpHandler = MyTcpHandler(self) self.tcpHandler.signal1.connect(self.imageRefresh) ...Also, avoid using global variables (such as global progressBar_statusValue). Instead of using threading module, initiate the thread in your gui loop and pass self in your thread instance. Then you can refer directly to the variable of the parent (self.parent.progressBar_statusValue) from the worker thread.