本文整理汇总了Python中PyQt.QtCore.QCoreApplication.setOrganizationDomain方法的典型用法代码示例。如果您正苦于以下问题:Python QCoreApplication.setOrganizationDomain方法的具体用法?Python QCoreApplication.setOrganizationDomain怎么用?Python QCoreApplication.setOrganizationDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt.QtCore.QCoreApplication
的用法示例。
在下文中一共展示了QCoreApplication.setOrganizationDomain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: chunks
# 需要导入模块: from PyQt.QtCore import QCoreApplication [as 别名]
# 或者: from PyQt.QtCore.QCoreApplication import setOrganizationDomain [as 别名]
from PyQt.QtCore import QCoreApplication, QSettings
def chunks(l, n):
for i in xrange(0, len(l), n):
yield l[i:i + n]
QCoreApplication.setOrganizationName("QGIS")
QCoreApplication.setOrganizationDomain("qgis.org")
QCoreApplication.setApplicationName("QGIS2")
s = QSettings()
ba = s.value("/UI/geometry").toByteArray()
f = open("src/app/ui_defaults.h", "w")
f.write("#ifndef UI_DEFAULTS_H\n#define UI_DEFAULTS_H\n\nstatic const unsigned char defaultUIgeometry[] =\n{\n")
for chunk in chunks(ba, 16):
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % ord(x), chunk)))
f.write("};\n\nstatic const unsigned char defaultUIstate[] =\n{\n")
ba = s.value("/UI/state").toByteArray()
for chunk in chunks(ba, 16):
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % ord(x), chunk)))
ba = s.value("/Composer/geometry").toByteArray()