Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Configuration file

    General and Desktop
    5
    5
    348
    Loading More Posts
    • 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.
    • G
      GrahamLa last edited by

      Hi
      I need to have some sort of configuration file that can be edited by a user.
      The configuration file will contain groupings of items for example

          PrintButton:
              Visible: true,
              AsPng: true,
              ForcePdf: false,
              GrayScale: false
      
      

      Has anyone got any ideas on how best to achieve this?

      Pablo J. Rogina 1 Reply Last reply Reply Quote 0
      • Pablo J. Rogina
        Pablo J. Rogina @GrahamLa last edited by

        @GrahamLa you may want to take a look at the QSettings class, which "provides persistent platform-independent application settings"

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 5
        • ODБOï
          ODБOï last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Kent-Dorfman
            Kent-Dorfman last edited by

            You might also look at JSON. I've found it to be very flexible for storing configuration entries and groups of configuration profiles.

            1 Reply Last reply Reply Quote 0
            • D
              Daniel Williams last edited by

              I've used the QSetttings class, too. It's very well done. You can instantiate an object QSettings qs("organization", "application") which basically groups the settings in a config file. On linux the file is stored at ~/.config/organization/appliction.conf. Then there are calls to read/write to the file. Try it, you'll like it ;)

              1 Reply Last reply Reply Quote 1
              • First post
                Last post