[Qt-interest] How to use ostream << operator with Qt?
Stephen Jackson
spjackson42 at gmail.com
Sat May 15 00:01:24 CEST 2010
On 14 May 2010 22:00, K. Frank wrote:
>
> I sometimes write an ostream "<<" operator for my classes, primarily for
> development and debugging purposes.
>
> Is there a common (and easy and lightweight) idiom for using iostream-style
> stuff to output diagnostic messages in Qt?
>
Are you aware of qPrintable()? e.g.
QString message = "Hello, world!";
std::cout << qPrintable(message) << "\n";
Alternatively, there's QTextStream which might be worth looking at.
--
HTH,
Stephen Jackson
More information about the Qt-interest-old
mailing list