Advertisement
Guest User

Pydev: Editor doesn't PyQt?

a guest
Mar 21st, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. from PyQt4.QtCore import *  # no error
  5. from PyQt4.QtGui import *  # no error
  6.  
  7.  
  8. class testWidget(QWidget):  # error 'undefined variable: QWidget
  9.     def __init__(self, parent=None):
  10.         super(testWidget, self).__init__(parent)
  11.  
  12.  
  13. if __name__ == '__main__':
  14.     import sys
  15.     import platform
  16.  
  17.     print('Python Version {}, Qt Version {}, PyQt Version {}, System {}'.\
  18.           format(platform.python_version(), QT_VERSION_STR,
  19.           PYQT_VERSION_STR, platform.system()))
  20.       # error 'undefined variable: QT_VERSION_STR & PYQT_VERSION_STR
  21.  
  22.     app = QApplication(sys.argv)  # error 'undefined variable: QApplication
  23.     widget = testWidget()
  24.     widget.show()
  25.     app.exec_()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement