本文整理汇总了Python中Tc2Config.settings方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.settings方法的具体用法?Python Tc2Config.settings怎么用?Python Tc2Config.settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tc2Config
的用法示例。
在下文中一共展示了Tc2Config.settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settings [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.layout()
self.restoreSettings(Tc2Config.settings())
self.handleFontChanged(globalObject.settingsGlobal.guiFont())
globalObject.settingsGlobal.guiFontChanged.connect(self.handleFontChanged)
示例2: open
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settings [as 别名]
#NOTE: looks like Qt is only checking for write protect anything else may or may not pass ..and we don't get any IO errors
# so we try in advance. obv there are still loopholes
fp = None
try: fp = open(fileName, 'w').close()
except Exception, d:
Tc2Config.msgWarning(self, 'Could Not Open Config File\n\n%s' % d)
return
finally:
if fp is not None: fp.close()
newSettings = QtCore.QSettings(fileName, QtCore.QSettings.IniFormat)
if not newSettings.isWritable():
Tc2Config.msgWarning(self, 'Config File Is Not Writable')
return
settings = Tc2Config.settings()
for key in settings.allKeys():
newSettings.setValue(key, settings.value(key) )
def onHelp(self, *args):
Tc2GuiHelp.dialogHelp('settingsGlobal', parent=self)
def guiStyle(self):
return self.groupGuiStyle.value()
def setGuiStyle(self, value):
style = QtGui.QStyleFactory.create(value)
#TODO: we currently set no palette. QStyle docs say palette should not be set
# for styles that use system defaults, but there seems to be no way to find out
# so ..and where to find some kind of default palette.
##QtGui.qApp.setPalette(style.standardPalette())