Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:27:49+00:00 2026-06-14T17:27:49+00:00

In my project lots of time i am using QMessageBox. which is for warning

  • 0

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 .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:27:50+00:00Added an answer on June 14, 2026 at 5:27 pm

    You can declare your own static information, warning and critical functions that will show original QMessageBox and also write something to log.

    static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton);
    
    StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton) 
    {
       qDebug() << "writing to log";
       return QMessageBox::information (parent, title, text, buttons, defaultButton)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just recently got involved in a classic ASP.NET project which contains lots
The project that I am working on (Node.js) implies lots of operations with the
in a rails project i have to deal with lots of strings, that are
I'm using log4j for the first time in a project. A fellow programmer told
We develop applications for the Flash platform, which have LOTS of run-time loaded assets
I am using Google Maps in a project and I want to display only
I'm re-working an ant build file that we've been using on our project for
I've just started working on a project that requires me to do lots of
In the following scenario: I got a project having a catalog of currently some
I have an old VC 6.0 project with lots of C files. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.