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
QtWS25 Last Chance

QSetting to create lock on .ini file

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 727 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 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
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #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
        • JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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 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
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by Christian Ehrlicher
              #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

              mrjjM 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

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

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on 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

                • Login

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