PDA

View Full Version : Get the qDebug() output to QString



umulingu
4th March 2010, 07:36
Hai

I want get the screen output of qDebug() or printf or fprintf to a QString Variable

how to do this?



int a=0x3F4ccccd;
QString hexA;
qDebug("%x",a); // i want this output in a QString hexA Variable.





help please

aamer4yu
4th March 2010, 07:41
Please avoid starting new threads for similar problems.

jillian
6th March 2010, 18:46
Why not start out with it in a QString, and then print it to screen:



int a = 0x3F4ccccd;
QString hexA = QString::number(a, 16);
qDebug(hexA.toStdString().c_str());

ChrisW67
8th March 2010, 02:09
You might also be interested in:

QtGlobal, particularly qInstallMsgHandler() if you want to globally redirect qDebug() and friends.