[Interest] QSettings: is a group present? Crash with qWarning.

Jan Kundrát jkt at flaska.net
Fri Aug 24 10:47:47 CEST 2012


On 08/23/12 16:51, Sensei wrote:
> 	qWarning("Contains [first]: %d", s.childGroups().contains("first")); // 
> BOOM!

You might want to switch to the stream-based operators which provide
prettier syntax and support printing of non-POD types like QString as well:

#include <QDebug>

qWarning() << "Contains [first]:" << s.childGroups().contains("first");

With kind regards,
Jan

-- 
Trojita, a fast e-mail client -- http://trojita.flaska.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120824/2f2e91b4/attachment.sig>


More information about the Interest mailing list