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. QSettings ini format [SOLVED]
Qt 6.11 is out! See what's new in the release blog

QSettings ini format [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.1k 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.
  • S Offline
    S Offline
    SysTech
    wrote on last edited by
    #1

    Hi all,

    My app requirement is an (ugh...) ini file that can be hand edited if required.

    The app will run on Win7 32. The logged in user will be an admin.

    I'm creating Settings as:

    @QSettings(QSettings::IniFormat, QSettings::UserScope, APP_ORG, APP_NAME)@

    Where APP_ORG is "Company"
    APP_NAME is "ICS"

    Everything seems to work however instead of an INI anywhere to be found a registry key is created in the spot mentioned in the documentation.

    I might be missing something but I thought this constructor would basically setup an ini file in the:

    <user>/application data/local/Company/ICS.ini

    What am I missing? Thanks in advance.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You can get the location of the file with QSettings::fileName()

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SysTech
        wrote on last edited by
        #3

        Hi SGaist,

        Well it doesn't. I did print it:

        Settings file: "\HKEY_CURRENT_USER\Software\CompanyICS"

        Note that it is HKEY_CURRENT_USER. So it is ignoring the Ini format request.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Strange… Which version of Qt are you using ?

          In between, you can use the 4th constructor giving a file pathname

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SysTech
            wrote on last edited by
            #5

            I have community, 5.4.0, creator 3.3.0. Built Dec 8, 2014.

            I will try the path based constructor. I guess I should file a bug report?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SysTech
              wrote on last edited by
              #6

              Ok I finally figured this out. It turns out there was a Settings object being created from prior testing and somehow that one was getting used in my debug tests. My bad. There appears to be no issue with this!

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Good ! It's not an unknown feature :)

                Happy coding !

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                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