Want more features on Pastebin? Sign Up, it's FREE!
Guest

Pydev: Editor doesn't PyQt?

By: a guest on Mar 21st, 2013  |  syntax: Python  |  size: 0.74 KB  |  views: 56  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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_()
clone this paste RAW Paste Data