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. QSetting to create lock on .ini file
Forum Update on Monday, May 27th 2025

QSetting to create lock on .ini file

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 744 Views
  • 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.
  • N Offline
    N Offline
    npatil15
    wrote on 10 Apr 2020, 07:13 last edited by
    #1

    Hello,

    How I can create lock on .ini file using QSetting or any other way so that user cannot chnage it manually?

    Please give your sugestions.

    Thanks

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 10 Apr 2020, 07:20 last edited by
      #2

      @npatil15 said in QSetting to create lock on .ini file:

      Please give your sugestions.

      It's not possible with Qt.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 10 Apr 2020, 07:26 last edited by mrjj 4 Oct 2020, 07:32
        #3

        Hi
        Its normal is done via OS access right restrictions and not something Qt can do for you.

        You can encrypt/scramble the values to make it
        much harder to edit manually.
        like
        https://wiki.qt.io/Simple_encryption_with_SimpleCrypt
        or similar ( its old) . dont use base64 as that easy still to manually change.

        Any user wanting access can reverse engineer your app and get encryption key but it would make it very hard for ordinary user jus t to open and edit the ini file.

        1 Reply Last reply
        1
        • J Offline
          J Offline
          JonB
          wrote on 10 Apr 2020, 08:37 last edited by
          #4

          And further to above two correct comments, possible solutions/approaches would depend on what you mean by "lock": is the "cannot change it manually" to mean while your Qt application is running only or to mean also while my Qt application is not running?

          1 Reply Last reply
          1
          • N Offline
            N Offline
            npatil15
            wrote on 10 Apr 2020, 09:41 last edited by
            #5

            Yes, LOCK means one should not able to change it manually, that's it!
            during running and not running as well, want only application can change it.

            It's not much secure file, but as a feature I dont want user should edit file manually as it should be editable from application only.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 10 Apr 2020, 10:49 last edited by Christian Ehrlicher 4 Oct 2020, 10:49
              #6

              This is not even possible on the os level. When you program can read/write the file than the user can do it also.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              M 1 Reply Last reply 10 Apr 2020, 11:07
              1
              • C Christian Ehrlicher
                10 Apr 2020, 10:49

                This is not even possible on the os level. When you program can read/write the file than the user can do it also.

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 10 Apr 2020, 11:07 last edited by
                #7

                @Christian-Ehrlicher
                Hi
                In normal install cases then yes.
                its possible to run the app with other credentials than the login user and thereby grand it
                access to resources the user cannot see. But im pretty sure its outside of the possibilities of the poster. :)

                1 Reply Last reply
                2

                2/7

                10 Apr 2020, 07:20

                topic:navigator.unread, 5
                • Login

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