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


Python Tc2Config.settings方法代码示例

本文整理汇总了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)
开发者ID:Kostafun,项目名称:tablecrab,代码行数:7,代码来源:Tc2GuiToolsSessionEditor.py

示例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())
开发者ID:Kostafun,项目名称:tablecrab,代码行数:32,代码来源:Tc2GuiSettingsGlobal.py


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