QDebugStream Class Reference

A convenience class for wrapping the standard iostreams into objects, which will send the output to qdebug. More...

#include <qdebugstream.h>

List of all members.

Public Member Functions

 QDebugStream (std::ostream &stream)
 ~QDebugStream ()

Protected Member Functions

virtual int_type overflow (int_type v)
virtual std::streamsize xsputn (const char *p, std::streamsize n)


Detailed Description

A convenience class for wrapping the standard iostreams into objects, which will send the output to qdebug.

It is faster, of course, to write directly to qDebug, but if you have existing code that uses iostream and want a cheap way of redirecting, this is it.

Usage: QApplication app(argc, argv);

these redirect both cout/cerr QDebugStream qdsOut(std::cout); QDebugStream qdsErr(std::cerr);

now start using cout and cerr normally std::cerr << "Oops"; // this goes to your QDebug handler

Original idea came from here: http://www.qtforum.org/thread.php?threadid=678

Definition at line 32 of file qdebugstream.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 30 01:15:44 2009 for oopapidocs by  doxygen 1.5.1