Quantcast
Channel: How does QDebug()
Viewing all articles
Browse latest Browse all 5

Answer by R Samuel Klatchko for How does QDebug()

$
0
0

When you write that this is the typical usage:

debug() << "stuff" << "more stuff" << std::endl;

are you definitely planning to construct a debug object each time you use it? If so, you should be able to get the behavior you want by having the debug destructor add the newline:

~debug()
{
    *this << std::endl;

    ... the rest of your destructor ...
}

That does mean you cannot do something like this:

// this won't output "line1" and "line2" on separate lines
debug d;
d << "line1";
d << "line2";

Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images