title: Window switching and threading in PyQt5
body: <p>I am working on GUI with PyQT. My goal is to make a program that reads the id from RFID card and switches windows after reading.</p>
  <p>My current problem is that when I run the program the first window (lock screen) won't show at all, but after reading the card the second window(menu) shows up. I can't find my way this problem. My first try was without threading at all but I thought threading would help on this problem, but I ended up in same situation. Reading the card works and so on, but I assume problem is on Qt as I dont have lot of experience with Qt.</p>
  <pre><code>class ThreadRFID(QtCore.QThread):
  
     signal = QtCore.pyqtSignal(str, str, int)
     successSignal = QtCore.pyqtSignal()
  
     def __del__(self):
        self.wait()
  
     def read(self):
         #Initialize RFID Reader
         reader = SimpleMFRC522()
         while True:
             #here reading the card and processing data...
             id, text = reader.read()
             self.successSignal.emit()
  
  class UILock(object):
     def __init__(self):
         super(UILock, self).__init__()
  
     def setupUI(self, MainWindow):
         MainWindow.setGeometry(50, 50, 400, 450)
         MainWindow.setFixedSize(400, 450)
         MainWindow.setWindowTitle(&quot;UILockTab&quot;)
  
   class UIMenu(object):
     def __init__(self):
         super(UIMenu, self).__init__()
  
     def setupUI(self, MainWindow):
         MainWindow.setGeometry(50, 50, 400, 450)
         MainWindow.setFixedSize(400, 450)
         MainWindow.setWindowTitle(&quot;UIWindow&quot;)
  
   class MainWindow(QMainWindow):
     def __init__(self, parent=None):
         super(MainWindow, self).__init__(parent)
         self.UILock = UILock()
         self.UIMenu = UIMenu()
         self.startLockTab()
  
     def startLockTab(self):
         self.UILock.setupUI(self)
         self.show()
         self.myThread = ThreadRFID(self)
         self.myThread.read()
         self.myThread.successSignal.connect(self.UIMenu.setupUI)
  
     def startUIWindow(self):
         self.UIMenu.setupUI(self)
         self.show()
  
   if __name__ == '__main__':
       import sys
       app = QtWidgets.QApplication(sys.argv)
       MW = MainWindow()
       MW.show()
       sys.exit(app.exec_())
  </code></pre>