Advertisement
stuppid_bot

PyQt4 Hello World

Dec 21st, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from PyQt4 import QtGui
  3.  
  4. class HelloWorld(QtGui.QWidget):
  5.     def __init__(self, parent=None):
  6.         QtGui.QWidget.__init__(self, parent)
  7.         self.parent = parent
  8.         self.initUi()
  9.        
  10.     def initUi(self):
  11.         self.setWindowTitle(u"Привет мир")
  12.         self.resize(300, 200)
  13.         self.show()
  14.        
  15.     def paintEvent(self, event):
  16.         p = QtGui.QPainter(self)
  17.         p.drawText(10, 20, u"Привет, мир!")
  18.  
  19. if __name__ == '__main__':
  20.     app = QtGui.QApplication([])
  21.     w = HelloWorld()
  22.     app.exec_()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement