[Qt-interest] console output to the dialog window
kai.koehne at nokia.com
kai.koehne at nokia.com
Tue Feb 14 14:09:30 CET 2012
> -----Original Message-----
> From: qt-interest-bounces+kai.koehne=nokia.com at qt.nokia.com [mailto:qt-
> interest-bounces+kai.koehne=nokia.com at qt.nokia.com] On Behalf Of ext
> Sajjad
> Sent: Tuesday, February 14, 2012 11:37 AM
> To: qt-interest at trolltech.com
qt-interest at trolltech.com and qt-interest at qt.nokia.com are both deprecated, please use interest at qt-project.org (A lot of people will miss your e-mails otherwise).
> Subject: [Qt-interest] console output to the dialog window
>
> Hello forum,
>
> I have installed a debug message handler which all the qDebug() output to a
> file.
>
> I would like to send the output to the dialog window instead, where a text
> editor will contain the output.
>
> Is that possible to send it directly to text editor or i have to read the whole
> file again ?
Sure, you could do something alike
static QMyDialog *myDialog = 0;
void myMessageHandler(QtMsgType type, const char *msg)
{
if (myDialog)
myDialog->addWarning(msg);
else
fprintf(stderr, "%s", msg);
}
and set the myDialog pointer to your dialog object (but don't forget to unset it after deletion of the dialog, otherwise you'll get crashes).
Regards
Kai
More information about the Qt-interest-old
mailing list