Search code examples
pythoneclipsepydevpyside

Why is QtGui.QApplication working but marked as undefined in PyDev?


In my Python 2.7.3 application, using PySide 1.1.2 and Qt 4.8.4, I do the following:

from PySide import QtGui
app = QtGui.QApplication(sys.argv)

The code is working fine, with some more commands afterwards the Qt window is correctly created. However, in Eclipse/PyDev QApplication is underlined red and the mouse over popup says

Undefined variable from import: QApplication

Is there any way to fix this in Eclipse/PyDev?


Solution

  • Go to window>preferences>interpreter - python>forced Builtins(tab)> click the new button on that tab and add PySide