[BUG] QSettings strangeness WAS: Re: [PyKDE] QSettings.subkeyList not working?

Hans-Peter Jansen hpj at urpla.net
Mon Nov 11 00:15:01 GMT 2002


Hi Trolls,

recently, I stumbled across a strange Qt behaviour:
when supplying an absolute config path with QSettings, Qt seems to miss
subkey lists, but lists simple entries. Omiting the leading slash corrects
this behaviour.

See supplied source: test.cpp, test.py.

Also note, that when renaming keys/subkey on subsequent calls, one would 
expect to preserve former entries. This isn't true, but maybe this is due 
to the simplicity of the test.

This happens at least with Qt 3.0.5 from SuSE 8.1.

Regards,
Hans-Peter

On Sunday 10 November 2002 12:53, Phil Thompson wrote:
> On Saturday 09 November 2002 12:42 pm, Hans-Peter Jansen wrote:
> > Hi Phil et al.,
> >
> > while adopting QSettings for my hand rolled config stuff, I stumbled
> > over the QSettings.subkeyList() not working as expected:
> >
> > Qt doc says, entryList return all entries, which are not keys, while
> > subkeyList return all keys. At least in my tests under X11/linux,
> > subkeyList always return an empty list, but OTOH, they find their way
> > into the config file ($HOME/.qt/testrc in this case).
>
> In my testing subkeyList() is returning a list containing only "test". A
> C++ version does the same thing. I don't know whether it is a bug or a
> misunderstanding - but I don't think it is a PyQt problem.
>
> Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 1603 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20021111/a5bd7ee0/test.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 914 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20021111/a5bd7ee0/test.py


More information about the PyQt mailing list