[Interest] Calling QSettings::value() with an empty key name triggers an assert
etienne.sandre at m4x.org
Wed Oct 2 17:35:04 CEST 2013
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
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest