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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:57:26+00:00 2026-05-18T02:57:26+00:00

Hello I have created an application using qt and I managed to save some

  • 0

Hello I have created an application using qt and I managed to save some of its settings using QSettings.

void DoneIt::writeSettings()
{
    QSettings settings("mycompany", "RightDoneIt");
    settings.beginGroup("DoneIt");
    settings.setValue("size", size());
    settings.setValue("pos", pos());
    settings.endGroup();
}

void DoneIt::readSettings()
{
    QSettings settings("mycompany", "RightDoneIt");
    settings.beginGroup("DoneIT");
    resize(settings.value("size", QSize(400, 400)).toSize());
    move(settings.value("pos", QPoint(200, 200)).toPoint());
    settings.endGroup();
}

That works fine with the window position and size.
I have add some widgets in my application using the designer of qt and I would like to save their state too.

One of my widgets is a radio button and I call it radioButtonbnw

How can I save its state (checked or unchecked) ?

What are the best practises ?

  • 1 1 Answer
  • 24 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-18T02:57:27+00:00Added an answer on May 18, 2026 at 2:57 am
    1. Put them to QButtonGroup.
    2. Use QButtonGroup::setId to set Id for each radio button in this group.
    3. Save the Id of the checked button get by QButtonGroup::checkedId.
    4. Get the pointer of this button using QButtonGroup::button(id) when restore, and call QAbstractButton::setChecked.

    BTW: if you want to saves the current state of mainwindow’s toolbars and dockwidgets, use QMainWindow::saveState.

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

Sidebar

Related Questions

I have created a simple hello world application in xcode using the command line
I have a library I created, File mylib.c: #include <mylib.h> int testlib() { printf("Hello,
Hello we have an SQL server application running over a low bandwith connection. We
I have a file called hellowf.cs class MyFirstApp { static void Main() { System.Windows.Forms.MessageBox.Show(Hello,
I have the following line: 14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;) I parse this by using a
We have an application that is built with Excel as the front end using
I have created an application in facebook,all is working fine except the publish to
Hello I have been tasked with creating a fairly complex web application in php,
I have created an fbml application. I have tried numerous examples of fbjs but
So, I have created a Zend application following the quick start guide (so it

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.