How to Solve NameError: name 'QtGui' is not defined -- PyQt4

Solution: Import the 'QtGui' module

To Solve the error, add the following line to the top of your code.

from PyQt4 import QtGui

 

For more information:
Python PyQt4 QtGui