[Development] Removing QBool?

David Faure david.faure at kdab.com
Sat Jan 7 01:03:50 CET 2012


QBool was introduced in Qt4 because qt3 had "int contains(...)" so there was a 
need for a compile error when writing (if contains(...) == 2).

But it surprises people, e.g. this code doesn't compile:
  QSettings::setValue("foo", qstringlist.contains("bar"));

And I've seen customer code using QBool as a bool container... "If it exists 
in Qt, it must be better..."

Shouldn't we clean that up for Qt5 and just use a bool for the contains method 
again? The Qt4 API ensures that nobody still has if (contains()==2) in their 
code anyway.

I can make the change next week if it's okay with everyone.

-- 
David Faure | david.faure at kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the Development mailing list