Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def splashScreen(self):
  2. img = QLabel(self.w)
  3. img.setGeometry(0,0,640,480)
  4. pixmap = QPixmap('background.png')
  5. img.setPixmap(pixmap.scaled(640,480,Qt.KeepAspectRatio))
  6. QTimer.singleShot(2000, img.hide)
  7.  
  8. def mainScreen(self):
  9. btn=QPushButton(self.w)
  10. btn.setText('Click')
  11. btn.move(270,228)
  12. btn.setCursor(QCursor(Qt.PointingHandCursor))
  13.  
  14. def run(self):
  15. self.mainScreen() # --> paint the button
  16. self.splashScreen() # --> paint the img on top layer
  17. self.w.show() # --> display the widget
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement