def qapplication(): """Either return a reference to an existing application instance or create a new one :return: A reference to the QApplication object """ app = QApplication.instance() if app is None: QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts) argv = sys.argv[:] argv[0] = APPNAME # replace application name # Workaround a segfault with the IPython console when using Python 3.5 + PyQt 5 # Without this using this fix the above combination causes a segfault when the IPython # console is started # The workaround mentioned in https://groups.google.com/forum/#!topic/leo-editor/ghiIN7irzY0 # is to ensure readline is imported before the QApplication object is created if sys.version_info[0] == 3 and sys.version_info[1] == 5: importlib.import_module("readline") app = QApplication(argv) app.setOrganizationName(ORGANIZATION) app.setOrganizationDomain(ORG_DOMAIN) app.setApplicationName(APPNAME) app.setApplicationVersion(mantid_version_str()) # Spin up the usage service and set the name for the usage reporting # The report is sent when the FrameworkManager kicks up UsageService.setApplicationName(APPNAME) if is_required_version(required_version='5.10.0', version=qVersion()): app.setAttribute(Qt.AA_DisableWindowContextHelpButton) return app
def __init__(self, parent=None): super(AboutWindow, self).__init__(parent, Qt.Window) self.ui = Ui_Form() self.ui.setupUi(self) self.ui.pydmVersionLabel.setText( str(self.ui.pydmVersionLabel.text()).format( version=pydm.__version__)) pyver = ".".join([str(v) for v in sys.version_info[0:3]]) self.ui.modulesVersionLabel.setText( str(self.ui.modulesVersionLabel.text()).format( pyver=pyver, numpyver=numpyver, pyqtgraphver=pyqtgraphver, pyqtver=PYQT_VERSION_STR, qtver=qVersion())) self.populate_external_tools_list() self.populate_plugin_list() self.populate_contributor_list()
def __init__(self, parent=None): super(AboutWindow, self).__init__(parent, Qt.Window) self.ui = Ui_Form() self.ui.setupUi(self) self.ui.pydmVersionLabel.setText(str(self.ui.pydmVersionLabel.text()).format(version=pydm.__version__)) pyver = ".".join([str(v) for v in sys.version_info[0:3]]) self.ui.modulesVersionLabel.setText(str(self.ui.modulesVersionLabel.text()).format(pyver=pyver, numpyver=numpyver, pyqtgraphver=pyqtgraphver, pyqtver=PYQT_VERSION_STR, qtver=qVersion())) self.populate_external_tools_list() self.populate_plugin_list() self.populate_contributor_list()