当前位置: 首页>>代码示例>>Python>>正文


Python QApplication.setOrganizationName方法代码示例

本文整理汇总了Python中qtpy.QtWidgets.QApplication.setOrganizationName方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.setOrganizationName方法的具体用法?Python QApplication.setOrganizationName怎么用?Python QApplication.setOrganizationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtpy.QtWidgets.QApplication的用法示例。


在下文中一共展示了QApplication.setOrganizationName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: qapplication

# 需要导入模块: from qtpy.QtWidgets import QApplication [as 别名]
# 或者: from qtpy.QtWidgets.QApplication import setOrganizationName [as 别名]
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)

    return app
开发者ID:samueljackson92,项目名称:mantid,代码行数:29,代码来源:mainwindow.py


注:本文中的qtpy.QtWidgets.QApplication.setOrganizationName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。