If I understand the documentation correctly, the QtCore.QSettings.value() method's second argument can be a QVariant default value. However, when I provide a key that does not exist, I'm not defaulting to that value. Observe when I try to read the settings for a configuration that does not exist:
>>> from PyQt4 import QtCore
>>> settings = QtCore.QSettings('MyComp', 'NoConfig')
>>> settings.beginGroup('NoExist')
>>> print settings.value("pos", QtCore.QVariant(100, 100)).toSize()
PyQt4.QtCore.QSize(-1, -1)

Why am I receiving a QSize(-1, -1) object instead of QSize(100, 100)?
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to