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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:28:31+00:00 2026-06-13T11:28:31+00:00

I read some QSettings from an .ini file: QSettings* settingsDocRoot=new QSettings(_settingsFile ,QSettings::IniFormat, parent); This

  • 0

I read some QSettings from an .ini file:

QSettings* settingsDocRoot=new QSettings(_settingsFile ,QSettings::IniFormat, parent);

This is passed to some object. However, I then do a copy QSettings* s2= new QSettings(settingsDocRoot); and modify one particular value s2->setValue("path", whateverNewPath);

Basically I want to pass a slightly modified QSettings object to another object. But how do I avoid that the original ini file is updated with the changed value (s2->setValue)?

One idea was, simply to set the path to “”. However, according to QSettings – where is the location of the ini file? then a default location will be assumed (OK, original file will not be changed, but unnecessary file will be written).

  • 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-13T11:28:32+00:00Added an answer on June 13, 2026 at 11:28 am

    I am currently doing the following:

        QSettings* settingsWsNaviGraph = new QSettings(settingsDocRoot);
        // avoid writing to file
        settingsWsNaviGraph->setPath(QSettings::InvalidFormat, QSettings::UserScope, "");
    

    This dirty hack seems to avoid writing, at least my original file remains unchanged and I do not see any unwanted file yet (will report if I do find one).

    If this here does not work, I’ll try to register my own format with bogus read/write methods. See here

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

Sidebar

Related Questions

I am trying to read some settings from php.ini using zend. The API that
I have created an applet to read some info from a file on the
I read some of the discussion in this question and thought to myself that
i read some wisdom like this : Programmers are encouraged to be careful when
I am trying to read some XML code from a website, and am having
I'm trying to deserialize some settings from an xml file. The problematic property/underlying field
My C# application have to read some date from MySQL database. Problem I have
Working on a application which reads some values from an customers.xml file to UI.
I'm attempting to read data from a serial port, show the data in some
I have a method where I READ objects from DB, for instance: public Object

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.