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

Sensei senseiwa at gmail.com
Fri Aug 24 08:04:49 CEST 2012


On 8/23/12 5:21pm, Samuel Gaist wrote:
> Hi,
>
> Looks like your on mac, trying on mine I get this at compilation time:
>
> warning: cannot pass objects of non-POD type 'class QBool' through '...'; call will abort at runtime
>
> Here is the why of your crash
>
> Hope it helps


Samuel, it help, actually!

First, after changing the offending line to the following, it works as 
expected:

	qWarning("Contains [first]: %d", s.childGroups().contains("first") == 
true);


But the real problem is this: why is the documentation referring to 
bool, and not to QBool?

	http://qt-project.org/doc/qt-4.8/qstringlist.html#contains

	bool QStringList::contains ( const QString & str, Qt::CaseSensitivity 
cs = Qt::CaseSensitive ) const


Actually, the header refers to QBool, as you correctly point out:

	inline QBool contains(const QString &str, Qt::CaseSensitivity cs = 
Qt::CaseSensitive) const;



So there's a "bug" in the docs... am I right?




More information about the Interest mailing list