[Qt-interest] Semi-OT: indentation with operator<<

Andre Somers andre at familiesomers.nl
Mon Aug 2 16:26:19 CEST 2010


Hi Frank,

Op Ma, 2 augustus, 2010 3:57 pm, schreef K. Frank:

> Thank you for the additional improvements.  I like it.
Good, glad you do.

> I especially like this idea of defining op<< for Indenter.  Very clean.
Yes, it does clean up quite nicely. I hope you are seeing the value of the
C++ way by now ;-)

> After all, variables with names beginning with the letters
> 'I' through 'N' are automatically typed as integers.  Oh, wait, that's
> not the case anymore -- that's a ghost from the steam-powered era.
Seriously? Way before my time, I'm afraid. Or perhaps I should be glad ;-)

> Now all we need to do is petition to make this QIndenter...
>
> (Just kidding, but I'm trying to make this thread on-topic somehow.)
:-)
What you could seriously look into is using qt's facilities for outputting
your debug data though, or perhaps even use some other logging framework.
Qt provides you with QtDebug's qDebug(), qWarning() and qFatal, which are
quite useful. Output goes to the windows debug stream (and stdout/stderr
if you add console to your config) on windows, and stdout/stderr on other
platforms.

If you want more fine grained control, look into qxt's QxtLogger. It has
several engines you can use to direct your output to a file, to std or to
whereever you want. I created a simple engine to use it with windows debug
stream that I have submitted for inclusion.

André





More information about the Qt-interest-old mailing list