kDebug formatting

Thiago Macieira thiago at kde.org
Mon Aug 6 02:14:45 BST 2007


David Jarvie wrote:
>Do you mean that _all_ QString's passed will be automatically quoted? If
> not, that would seem to imply that QDebug parses QString parameters to
> check whether they seem to be file name syntax. Unfortunately, QDebug
> isn't particularly well documented.

Yes:

    inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t  
<< "\""; return maybeSpace(); }

As are all QByteArrays.

If, for any reason, you want to output one string unquoted, use 
qPrintable(string).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070805/cd98033c/attachment.sig>


More information about the kde-core-devel mailing list