PyQt4中的第一个窗口

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PyQt4中的第一个窗口相关的知识,希望对你有一定的参考价值。

  1. from PyQt4 import QtGui, QtCore
  2. import sys
  3.  
  4. class Window(QtGui.QMainWindow):
  5. def __init__(self):
  6. QtGui.QMainWindow.__init__(self) #import all widgets and core functions
  7. self.resize(200,200)
  8. self.setWindowTitle('First Window')
  9.  
  10. app = QtGui.QApplication(sys.argv)
  11. main = Window()
  12. main.show()
  13. sys.exit(app.exec_()) #freeze screen

以上是关于PyQt4中的第一个窗口的主要内容,如果未能解决你的问题,请参考以下文章