31 from python_qt_binding.QtCore
import QMutex, QMutexLocker, QObject
35 """Wrapper of a QSettings instance simplifying access of grouped data.""" 38 super(SettingsProxy, self).
__init__()
39 self.setObjectName(
'SettingsProxy')
42 self.
_mutex = QMutex(QMutex.Recursive)
45 locker = QMutexLocker(self.
_mutex)
46 self._qsettings.beginGroup(group)
47 keys = self._qsettings.allKeys()
48 self._qsettings.endGroup()
56 locker = QMutexLocker(self.
_mutex)
57 self._qsettings.beginGroup(group)
58 groups = self._qsettings.childGroups()
59 self._qsettings.endGroup()
63 locker = QMutexLocker(self.
_mutex)
64 self._qsettings.beginGroup(group)
65 keys = self._qsettings.childKeys()
66 self._qsettings.endGroup()
70 locker = QMutexLocker(self.
_mutex)
71 self._qsettings.beginGroup(group)
72 key_exists = self._qsettings.contains(key)
73 self._qsettings.endGroup()
79 locker = QMutexLocker(self.
_mutex)
80 self._qsettings.beginGroup(group)
81 self._qsettings.remove(key)
82 self._qsettings.endGroup()
87 locker = QMutexLocker(self.
_mutex)
88 self._qsettings.beginGroup(group)
89 self._qsettings.setValue(key, value)
90 self._qsettings.endGroup()
92 def value(self, group, key, default_value=None):
93 locker = QMutexLocker(self.
_mutex)
94 self._qsettings.beginGroup(group)
95 v = self._qsettings.value(key, default_value)
96 self._qsettings.endGroup()
def remove(self, group, key)
def set_value(self, group, key, value)
def all_keys(self, group)
def __init__(self, qsettings)
def child_keys(self, group)
def value(self, group, key, default_value=None)
def child_groups(self, group)
def contains(self, group, key)