def init_qapp(cls): # make sure we have a QApplication instance if QApplication.instance() is None: # check if we need a fake x-server # (applies to some linux batch nodes) if platform.system() == "Linux": xinit.launch_x() QApplication(sys.argv)