Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can we change the file path of ini file ?
Forum Updated to NodeBB v4.3 + New Features

How can we change the file path of ini file ?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pratik041
    wrote on last edited by
    #1

    Suppose initially i have given path
    @setting = new QSettings("../mainwindow/../../Aqua/SKIN.ini",
    QSettings::IniFormat);@
    later on i want to change path of file location to
    @"../ofi/../../file/red.ini@

    So how can i do that? I have tried
    @set path() @
    but i didn't find any change in path in my .ini file.

    Pratik Agrawal

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexbottoni
      wrote on last edited by
      #2

      Are you sure that anything like that is actually possible?

      The path to the .ini file is given to the constructor of the QSettings object and the constructor is executed only once in the life of this object (at the object construction time).

      So, as long as I can see, there is no way to redefine this variable later (Or, at least, I cannot see any method to perform such a action in the QSetting's documentation).

      Most likely, you should destroy the existing QSettings object and create a new one, with a new path to the .ini file.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        You will need to move the file using other code. The file will not magically relocate.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved