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 7614235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:21:08+00:00 2026-05-31T02:21:08+00:00

I am currently creating a dialog with a check box that says Do no

  • 0

I am currently creating a dialog with a check box that says “Do no display again”. When the check box is clicked and the dialog is closed (ok button pressed), the application will store in QSettings that this dialog box has been opened before.

I’m not familiar with Qt settings and looking at the API, I don’t know which function to use.

Could anyone point me to the right direction? Thank you!

Btw I did try QErrorMessage, but the message box keeps popping up so I gave up on it.

void MessageBox::on_checkBox_stateChanged(int arg1)
{
    if(ui->checkBox->stateChanged(arg1) && ui->pushButton->clicked(true))
    //I believe this is right.
    {
       writeSettings();
    }
}

void MessageBox::writeSettings()
{
    QSettings settings;
//...help; Question: Should I write in main.cpp or in the .h?
}

void MessageBox::readSettings()
{
//...help
}
  • 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-05-31T02:21:09+00:00Added an answer on May 31, 2026 at 2:21 am

    To use the QSettings constructor in this form, you must set the organization and application name for your application, probably in main.cpp if you create it there:

    QApplication a(argc, argv);
    a.setOrganizationName("MySoft");
    a.setApplicationName("Star Runner");
    

    Then in your writeSettings() you do:

    QSettings settings;
    settings.setValue("showErrorMessages", ui->checkBox->isChecked());
    

    and in readSettings()

    QSettings settings;
    bool showErrorMessages = settings.value("showErrorMessages", true).toBool()
    

    It’s all in the docs and explained quite clearly IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating an application for a customer that will allow them to automatically
I have a jQuery UI Dialog box, that I'm creating. It starts out as
I'm currently creating an explicit reference to this in the outer class so that
I'm currently creating a user interface using WPF and would like to display a
i'm currently creating a custom dialog (alertdialog is not flexible enough for my needs).
Im currently creating a uninstallation application which deletes the application folder. The problem is
Currently creating a VOIP application for Android and I was wondering is there any
I am currently developing an App for Android. I am creating an Alert Dialog
I am creating a facebook application in asp.net. I want that when user login
I'm creating a custom Spinner that shows a custom Dialog. For that, I created

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.