Link to home
Start Free TrialLog in
Avatar of HPFE455
HPFE455Flag for United States of America

asked on

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

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 project.pro file.
CONFIG   += console

But this will affecting the application logging.

Environment: QT 4.7.3/ Windows
Avatar of jkr
jkr
Flag of Germany image

What are you using for logging purposes?
Avatar of HPFE455

ASKER

qDebug(), qWarning()
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of HPFE455

ASKER

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.