title: PyQt5 splash screen before main window
body: <p>I am trying to create a splash screen that shows for 5 seconds before showing the main screen. However, I want the splash screen to be the same window as the main window just with a different image in the middle.</p>
  <p>I have looked at <a href="https://stackoverflow.com/questions/55842776/how-to-change-ui-in-same-window-using-pyqt5">How to change UI in same window using PyQt5?</a> but it still was not working...</p>
  <p>I have also tried using the QSplashScreen class but I could not get it to work properly. If there is any confusion, please feel free to comment and I will clarify.</p>
  <p>Here is my code script:</p>
  <pre><code># importing libraries 
  from PyQt5.QtWidgets import * 
  from PyQt5.QtGui import * 
  from PyQt5 import QtCore, QtGui 
  from PyQt5.QtCore import * 
  import sys   
   
    
  class Window(QMainWindow): 
      def __init__(self): 
          super().__init__() 
    
          self.setStyleSheet(&quot;background-color: black;&quot;)
          self.setWindowTitle(&quot;key&quot;) 
          self.setGeometry(100, 100, 350, 500) 
          self.UiComponents() 
          self.show() 
    
  
      def UiComponents(self): 
          lockButton = QPushButton(self) 
          lockButton.setGeometry(60, 200, 100, 70) 
          lockButton.setStyleSheet(&quot;border-radius : 10; border : 1px solid white; background-color : #3A3535&quot;) 
          lockButton.setIcon(QIcon('lock.png')) 
          size = QSize(40, 40) 
          lockButton.setIconSize(size)
          lockButton.clicked.connect(self.clickme) 
          
  
      def clickme(self): 
          print(&quot;pressed&quot;) 
    
  
  App = QApplication(sys.argv) 
  window = Window() 
  sys.exit(App.exec()) 
  </code></pre>