Well, I did not want to say "silently" when I said "quietly". I should have written : "It should fail but in a friendly manner, maybe with a qWarning"
Asserting is not very coherent for many reasons, including: - Staying silent in release mode is then a problem. - As Q_ASSERTs only work in debug mode they are not a proper solution here. Q_ASSERTS are there to signal dangerous situations when performance is critical and should not be degraded in release mode. I'm not sure this is appropriate here. - Why not using an assert when connecting wrong slot and signals, instead of a warning? - While not using an assert in QFile::open when using an empty file name? - QSettings::setValue could return a false boolean to warn that the operation failed. - .... Apart from this, thanks for the explanation about the "." and "Default", I did not notice it. Maybe this, along with the non-empty requirement, should be added to setValue() and value() documentation, but you maybe disagree :) Etienne 2013/10/3 Andre Somers <an...@familiesomers.nl> > Op 2-10-2013 17:35, Etienne Sandré-Chardonnal schreef: > > 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 > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest