Re: [PyQt] Saving PyObjects QSettings

2008-07-31 Thread Paul Giannaros
On Thu, Jul 31, 2008 at 3:11 PM, Paul Giannaros <[EMAIL PROTECTED]> wrote: > You do not need two config files this way. For example: > > o = pickle.dumps(myDevices) > settings.setValue('test', QVariant(o)) > print pickle.loads(str(settings.value(o).toString())) > Sorry, that last line should have

Re: [PyQt] Saving PyObjects QSettings

2008-07-31 Thread Paul Giannaros
You do not need two config files this way. For example: o = pickle.dumps(myDevices) settings.setValue('test', QVariant(o)) print pickle.loads(str(settings.value(o).toString())) On Thu, Jul 31, 2008 at 2:57 PM, Lukas <[EMAIL PROTECTED]> wrote: > Hello, > yes I know, but the disadvantage is that I

Re: [PyQt] Saving PyObjects QSettings

2008-07-31 Thread Lukas
Hello, yes I know, but the disadvantage is that I need two config files, so this is just me last resort Can I convert a list() to/from a QList() and save then this? Are QLists available in PyQt? On Thursday 31 July 2008 15:47:10 Paul Giannaros wrote: > You could just use the pickle module and sa

[PyQt] Saving PyObjects QSettings

2008-07-31 Thread Lukas
Hello, I wanted to save a PyObject in my QSettings: >>> from PyQt4.QtGui import * >>> app = QApplication([]) >>> settings = QSettings() >>> myDevices = list() >>> device = dict() >>> device["name"] = "just some testing" >>> device["addr"] = "00:22:33:5A:52" >>> myDevices.append(device) >>> QVar