Advertisement
Guest User

Untitled

a guest
Nov 8th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. class GUI(QMainWindow, form.Ui_Main_form):
  2.     def __init__(self):
  3.         super(GUI, self).__init__()
  4.         self.setAttribute(Qt.WA_DeleteOnClose)
  5.         self.setupUi(self)
  6.         self.scene = QGraphicsScene()
  7.         self.Graph.setScene(self.scene)
  8.         self.scene.clear()
  9.         self.scene.setSceneRect(0, 0, current_w, current_h)
  10.         self.imgQ = ImageQt.ImageQt(current_image)
  11.         pixMap = QPixmap.fromImage(self.imgQ)
  12.         self.scene.addPixmap(pixMap)
  13.         self.Graph.fitInView(QRectF(0, 0, current_w, current_h)), Qt.KeepAspectRatio
  14.         self.scene.update()
  15.  
  16. def main():
  17.     app = QApplication(sys.argv)
  18.     window = GUI()
  19.     window.show()
  20.     app.exec_()
  21.  
  22. if __name__ == '__main__':
  23.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement