Hi all,
I am trying to display the strings and values in console.
for that i have added CONFIG += console in pro file, but
I dont know what to use in cpp file to display .
I tried qtextstream but it doesnt help me.
plz give me any ideas.
Printable View
Hi all,
I am trying to display the strings and values in console.
for that i have added CONFIG += console in pro file, but
I dont know what to use in cpp file to display .
I tried qtextstream but it doesnt help me.
plz give me any ideas.
if it's for debug purpose use qDebug("Your text goes here");
Other than that you can use standard c / c++ methods, like:
printf("Your text");
or
std::cout << "Your text";
You can use std::cout just fine. Or if you want, you can do:
And that will work with standard output. The same is for stdin and stderr.
Bojan
Thank you Mike and Bojan,
I forgot to say my version, I am using 3.3.4 there is no qdebug class.
and I am working in Linux server, the above methods are not working for me.
the qDebug is present in 3.3.4Quote:
Originally Posted by peedarp
the std::cout is widely used on crossplatforms. So it is not platform related. Just if u use cout, try to put 'using namespace std' after the declarations...or the problem is other?:rolleyes:
You're right that there is no such class. But noone told you that there's one ;)Quote:
Originally Posted by peedarp
http://doc.trolltech.com/3.3/qapplication.html#qDebug