How to hide  console window in QT without affecting the application logging

HPFE455 used Ask the Experts™
My QT application is opening and closing  console window ( command prompt) while starting the application.

 I  have hidden the console window by  removing the below  config from the file.
CONFIG   += console

But this will affecting the application logging.

Environment: QT 4.7.3/ Windows
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012

What are you using for logging purposes?


qDebug(), qWarning()
Top Expert 2012
What about writing to a file then? I.e.

QFile qf("debuglog.txt");
QDebug qd(&qf);

// ...

Open in new window

or alternatively the method described at ("How to redirect qDebug output to a file")
qDebug() can print the log in IDE out put tab without having console open, this will be good for your development env but when you deploy your application you have no other choice but to use QFile for logging,
I can think of one more way of showing this data in some of your application window, like you mame a connection when ever you want to print any Qdegug() to one of you slot and write this debug data in some QTextWidget or something and keep this widget hidden unless you dont want to see this


Thanks jkr
My logging implementation is similar to the above link. But if  I disable the console,  the
message handler function is not getting called. It never hitting the break point.  The qInstallMsgHandler is implemented in a separate class.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial