"""
classes needing 'global' application attributes use for example: 
QCoreApplication.instance().mainWindow
"""


class MyApp(QApplication):

    def __init__(self, args):
        super(MyApp, self).__init__(args)
self.mainWindow = MainWindow()
How do I subclass QApplication properly?