[Development] QString behavior change

Florian Bruhin me at the-compiler.org
Fri Jul 31 09:55:45 CEST 2015


* Kobus Jaroslaw <Jaroslaw.Kobus at theqtcompany.com> [2015-07-31 07:46:07 +0000]:
> If you say not to differentiate empty and null states, some questions arise:
> 1) Why we have isNull and isEmpty at the same time?
> 2) Why their implementations are different?
> 3) What would be the advice on what to use in general: isNull of isEmpty?

See the documentation of QString::isNull():

    Qt makes a distinction between null strings and empty strings for
    historical reasons. For most applications, what matters is whether
    or not a string contains any data, and this can be determined
    using the isEmpty() function.

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150731/303d098c/attachment.sig>


More information about the Development mailing list