本文整理匯總了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)