index error in pyqtconfig with QListWidget
Axel Rau
Axel.Rau at Chaos1.DE
Wed Jul 21 10:30:41 BST 2021
This is the code to access and set the list settings:
- - -
def getPrefs(self):
self.prefs = sc.get(self.listPrefName)
return
def addPref(self, value):
self.getPrefs()
self.prefs.append(value)
sc.set(self.listPrefName, self.prefs)
self.printSettings('End addPref')
def setPref(self, index, value):
self.prefs[index] = value
sc.set(self.listPrefName, self.prefs)
print(l)
return l
def delPref(self, value):
self.getPrefs()
self.prefs.remove(value)
sc.set(self.listPrefName, self.prefs)
- - -
self.prefs is the list of values.
self.listPrefName is something like ’gen/ip4_nets'
sc is the pyqtconfig.QSettingsManager instance.
Axel
---
PGP-Key: CDE74120 ☀ computing @ chaos claudius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210721/8a1a17ba/attachment-0001.sig>
More information about the PyQt
mailing list