[Qt-interest] QLabel text () returns QString::null aftersetting empty QString

Thiago Macieira thiago at kde.org
Mon Sep 13 17:18:41 CEST 2010


On Monday 13. September 2010 13.18.46 Constantin Makshin wrote:
> Those are just my guesses, Qt developers may give a better explanation.

I already have: do not depend on the null-vs-empty distinction. Except when 
otherwise specified that it makes a difference, don't assume that the code makes 
a difference nor that it keeps the distinction. This note is in the 
documentation already.

The internal data representation may be something other than a QString (for 
example, for QTextEdit, it could have each line in an array, so when you ask 
for the full text, the code constructs the result).

One example where it does make a difference and is documented to be so is in 
QUrl.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100913/8f6bb599/attachment.bin 


More information about the Qt-interest-old mailing list