Single Log File for Qt Project.
hi,
i have a QT project in Linux with 4 windows(corresponding .cpp..h etc.,).
i want to maintain a single Log file for all the 4 windows.
how can i do that?:confused::confused:
Actually i tried creating the file and opening in main.cpp but it cannot be used in other .cpp files,
how can i use this file pointer in other windows. i tried with extern keyword but it is not working.
Thanks in advance.
Re: Single Log File for Qt Project.
Have a look at QtMsgHandler qInstallMsgHandler ( QtMsgHandler handler ) function in qt assistant. that will be usable in ur case
Re: Single Log File for Qt Project.
i dint find much information about .
Could you direct me .
Re: Single Log File for Qt Project.
you can use the singleton approach for passing the pointer to your four windows. But better you use the solution vishwajeet.dusane suggested you. To find informations use the assistant: On the left choose the tab "index" and type inside the search field "qInstallMsgHandler".
Or use the online documentation: QtGlobal::qInstallMsgHandler().
Re: Single Log File for Qt Project.
i want to use the singleton approach..
so how can i pass the File pointer..
could u suggest singleton
Re: Single Log File for Qt Project.
Have a look at our wiki: [WIKI]Singleton_pattern[/WIKI].