In the official example of "embedding mayavi in QT" http://docs.enthought.com/mayavi/mayavi/auto/example_qt_embedding.html#example-qt-embedding, the main code says:
if __name__ == "__main__":
# Don't create a new QApplication, it would unhook the Events
# set by Traits on the existing QApplication. Simply use the
# '.instance()' method to retrieve the existing one.
app = QtGui.QApplication.instance()
...
I am confused by this. What is the "existing QApplication"? This is the first line of the actual code, there was no existing QApplication. Also, what are the "Events set by Traits on the existing QApplication"?