Hi all,

When I store a list of strings (but happening to be empty) in
QSettings (using QString and QVariant api 2):

e.g.:

>>> paths = []
>>> QSettings().setValue('paths', paths)

Retrieving it yields a TypeError, instead of an empty list:

>>> QSettings().value('paths', [], 'QString')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unable to convert a QVariant of type 0 to a QMetaType of
type 10

What is the most elegant way to circumvent this? cathing the TypeError
and returning the empty list?

Best regards,
Wilbert

-- 
Wilbert Berendsen
(http://www.wilbertberendsen.nl)

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to