In my project lots of time i am using QMessageBox. which is for warning / information . For e.g. If i am having some validation then at that time i am using some QMessageBox::information(…) , or if i want to restrict the user not to move out of a particular page then i am using QMessageBox::critical(…) .
I know “How to redirect qDebug output to a file”.I want to do the same thing for the QMessagebox too. so that i will maintain a text file in my project folder . whenever the application run if the user encounters some message through QMessagebox , then that shall be redirected to that text file .So that after closing the application the user have a small list of messagedetails ,whatever he has encountered during running the application .

Please help me in writting this code ..

Thankxx in advance .