def gui(dev_mode=False): """Run the QAX gui""" # temporary fix for CORS warning (QTBUG-70228) sys.argv.append("--disable-web-security") # stop auto scaling on windows # os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" # stop auto scaling on windows - part 2 # app.setAttribute(QtCore.Qt.AA_DisableHighDpiScaling) # app.setStyleSheet(AppStyle.load_stylesheet()) cfg_dir = GuiSettings.config() # setup user editable config directory if not os.path.isdir(cfg_dir): # config does not exist, so copy out default settings logger.info("Copying default config to {}".format(cfg_dir)) import shutil shutil.copytree(GuiSettings.config_default(), cfg_dir) else: logger.info("Using existing config {}".format(cfg_dir)) config = QaxConfig(Path(cfg_dir)) config.load() plugins = QaxPlugins() plugins.load(config) main_win = MainWin() main_win.initialize() sys.excepthook = main_win.exception_hook # install the exception hook main_win.show() if dev_mode: main_win.do() sys.exit(app.exec_())
def gui(dev_mode=False): """Run the QAX gui""" # temporary fix for CORS warning (QTBUG-70228) sys.argv.append("--disable-web-security") # stop auto scaling on windows # os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" # stop auto scaling on windows - part 2 # app.setAttribute(QtCore.Qt.AA_DisableHighDpiScaling) # app.setStyleSheet(AppStyle.load_stylesheet()) cfg_dir = GuiSettings.config_default() logger.info("Using config {}".format(cfg_dir)) config = QaxConfig(Path(cfg_dir)) config.load() plugins = QaxPlugins() plugins.load(config) main_win = MainWin() main_win.initialize() sys.excepthook = main_win.exception_hook # install the exception hook main_win.show() if dev_mode: main_win.do() sys.exit(app.exec_())