本文整理汇总了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