Op 2-10-2013 17:35, Etienne Sandré-Chardonnal schreef:
Dear all,
I'm under windows, where registry supports a default value per key.
This means, a value with an empty name.
Using QSettings::setValue("", value) and QSettings::value("") works
fine and as expected in release mode. It creates and read default
values in the registry.
However, I was surprised that in debug mode, this triggers an assert
due to the empty string.
I think that:
1) This may be due to empty names which are not supported in other
platforms. In that case, it should be stated in the doc that the name
must not be empty.
2) Calling an Q_ASSERT on this is quite rude... It should fail but
cleanly, maybe with a qWarning.
3) Isn't there a way to port empty value names to other platforms?
Qt 4.8.1, should a bug be filed?
No. Your idea that you should use en empty string as the key is wrong.
The documentation states:
On Windows, it is possible for a key to have both a value and subkeys.
Its default value is accessed by using "Default" or "." in place of a
subkey:
So, you're just trying to access the default value in the wrong way. On
windows, empty key names are also not supported, so the assert is
correct. The assert is also, IMHO, a better solution than a rather
silent fail.
André
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest