Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PySide import QtCore
- from PySide import QtGui
- class View(QtGui.QMainWindow):
- def __init__(self):
- super(View, self).__init__()
- self.setFixedSize( QtCore.QSize(720, 480) )
- self.lbl = QtGui.QLabel(self)
- self.lbl.setGeometry(0, 0, 720, 480)
- self.timer = QtCore.QTimer(self)
- self.timer.timeout.connect(self.onTimeout)
- self.timer.start(100)
- def onTimeout(self):
- pxmp = QtGui.QPixmap.fromImage(QtGui.QImage('tiger.png'))
- self.lbl.setPixmap(pxmp)
- class TestApp:
- def __init__(self):
- self.qApp = QtGui.QApplication(['Test App'])
- self.view = View()
- self.view.show()
- def run(self):
- sys.exit( self.qApp.exec_() )
- if __name__=='__main__':
- app = TestApp()
- app.run()
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement