Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. # Write your code here :-)
  2. import sys
  3. from PyQt5 import QtCore, QtGui, QtWidgets
  4.  
  5. class Ui_Form(object):
  6.     def setupUi(self, Form):
  7.         Form.setObjectName("Form")
  8.         Form.resize(400, 300)
  9.         self.label = QtWidgets.QLabel(Form)
  10.         pixmap = QtGui.QPixmap("/home/jimmyho/mu_code/qtwiew/a.png")
  11.         self.label.setPixmap(pixmap)
  12.         self.label.setScaledContents(True)
  13.         self.label.setMinimumSize(50, 50)
  14.        
  15.        
  16. if __name__ == "__main__":
  17.     app = QtWidgets.QApplication(sys.argv)
  18.     Form = QtWidgets.QWidget()
  19.     ui = Ui_Form()
  20.     ui.setupUi(Form)
  21.     Form.show()
  22.     sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement