本文整理汇总了Python中PyQt4.Qt.QSettings.value方法的典型用法代码示例。如果您正苦于以下问题:Python QSettings.value方法的具体用法?Python QSettings.value怎么用?Python QSettings.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QSettings
的用法示例。
在下文中一共展示了QSettings.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __set_backup_path
# 需要导入模块: from PyQt4.Qt import QSettings [as 别名]
# 或者: from PyQt4.Qt.QSettings import value [as 别名]
def __set_backup_path(self):
settings = QSettings("GCI", "vertex-tools")
settings.beginGroup("BackupSettings")
default_path = QDir.tempPath()
backup_path = settings.value("backup_path", default_path)
self.backup_folder_edit.setText(backup_path)
settings.endGroup()
示例2: settingsValue
# 需要导入模块: from PyQt4.Qt import QSettings [as 别名]
# 或者: from PyQt4.Qt.QSettings import value [as 别名]
def settingsValue( key, default):
syslog.syslog( syslog.LOG_DEBUG,
"DEBUG settingsValue %s, default: %s" %
(key, str(default)))
s = QSettings()
var = s.value(key, default)
if not s.contains(key): s.setValue( key, var)
syslog.syslog( syslog.LOG_DEBUG,
"DEBUG settingsValue %s, value: %s" %
(key, var.toString()))
return var
示例3: __init__
# 需要导入模块: from PyQt4.Qt import QSettings [as 别名]
# 或者: from PyQt4.Qt.QSettings import value [as 别名]
class Config:
def __init__(self, organization, product):
self.config = QSettings(organization, product)
def setValue(self, option, value):
self.config.setValue(option, QVariant(value))
self.config.sync()
def getBoolValue(self, option):
default = self._initValue(option, False)
return self.config.value(option, QVariant(default)).toBool()
def getNumValue(self, option):
default = self._initValue(option, 0)
return self.config.value(option, QVariant(default)).toInt()[0]
def _initValue(self, option, value):
if defaults.has_key(option):
return defaults[option]
return value
示例4: read_settings
# 需要导入模块: from PyQt4.Qt import QSettings [as 别名]
# 或者: from PyQt4.Qt.QSettings import value [as 别名]
def read_settings(self):
logging.debug('Reading settings')
settings = QSettings()
read_settings = self.defaults.copy()
keys = settings.allKeys()
for k in keys:
setting_type = QTouTvSettings._settings_types[k]
read_settings[k] = settings.value(k, type=setting_type)
self.apply_settings(read_settings)