Avatar of HPFE455
HPFE455
Flag 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
C++

Avatar of undefined
Last Comment
HPFE455

8/22/2022 - Mon
jkr

What are you using for logging purposes?
HPFE455

ASKER
qDebug(), qWarning()
ASKER CERTIFIED SOLUTION
jkr

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
irfan_omair

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
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
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.