from log import EventData EventData(receiver, event) return QObject.eventFilter(self, receiver, event) from util import gitHead if os.name == 'nt': _ = os.path.dirname(os.path.realpath(__file__)) if _.endswith('.zip'): # cx_freeze os.chdir(os.path.dirname(_)) ABOUT = About() KCmdLineArgs.init(sys.argv, ABOUT.about) KCmdLineArgs.addCmdLineOptions(defineOptions()) APP = KApplication() parseOptions() if hasattr(QGuiApplication, 'setDesktopFileName'): QGuiApplication.setDesktopFileName('org.kde.kajongg') if Debug.neutral: KGlobal.translation = None if Debug.events: EVHANDLER = EvHandler() APP.installEventFilter(EVHANDLER) from config import SetupPreferences SetupPreferences()
"""an application wide event handler""" def eventFilter(self, receiver, event): """will be called for all events""" from log import EventData EventData(receiver, event) return QObject.eventFilter(self, receiver, event) from util import gitHead ABOUT = About() KCmdLineArgs.init(sys.argv, ABOUT.about) KCmdLineArgs.addCmdLineOptions(defineOptions()) if usingQt4: KApplication.setGraphicsSystem("raster") APP = KApplication() parseOptions() if Debug.neutral: KGlobal.locale().setLanguage("en_US") if Debug.events: EVHANDLER = EvHandler() APP.installEventFilter(EVHANDLER) from config import SetupPreferences SetupPreferences()