def get_app_qt4(*args, **kwargs):
    """Create a new qt4 app or return an existing one."""
    from PyQt4 import QtGui
    app = QtGui.QApplication.instance()
    if app is None:
        if not args:
            args = [''],
        app = QtGui.QApplication(*args, **kwargs)
    return app
