From Thundering Shama, 2 Weeks ago, written in Plain Text.
  1. class A(QWidget)
  2.  
  3.         def __init__(self,a,f,t):
  4.         super().__init__()
  5.                
  6.         Bobj=B()
  7.                 Cobj=C()
  8.    
  9.         self.threadB=QThread()
  10.         self.threadC=QThread()
  11.    
  12.         self.Bobj.moveToThread(threadB)
  13.         self.Cobj.moveToThread(threadC)
  14.        
  15.         self.Bobj.B_signal.connect(self.B.B_function)   #B_function runs in threadB
  16.         self.Bobj.B_signal.connect(self.A1_function)    #B_function runs in parent thread because A1_function runs in parent thread
  17.         self.Cobj.C_signal.connect(self.B.B_function)   #B_function runs in threadB
  18.         self.Cobj.C_signal.connect(self.A2_function)    #B_function runs in parent thread because A2_function runs in parent thread
  19.        
  20.        
  21.         self.threadB.start()
  22.         self.threadC.start()
  23.        
  24.         def A1_function(self,l)
  25.         self.B.B_function(l)
  26.        
  27.         def A2_function(self,l)
  28.         self.B.B_function(l)
  29.  
  30.  
  31. class B(QObject)
  32.         B_signal=pyqtSignal(list)
  33.    
  34.     def B_function(self,l):
  35.         #Some code here
  36.  
  37. class C(QObject)
  38.         C_signal=pyqtSignal(list)
  39.    
  40.     def C_function(self,l):
  41.         #Some code here
captcha