QSetting to create lock on .ini file
-
wrote on 10 Apr 2020, 07:13 last edited by
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
-
@npatil15 said in QSetting to create lock on .ini file:
Please give your sugestions.
It's not possible with Qt.
-
Lifetime Qt Championwrote on 10 Apr 2020, 07:26 last edited by mrjj 4 Oct 2020, 07:32
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.
-
wrote on 10 Apr 2020, 08:37 last edited by
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?
-
wrote on 10 Apr 2020, 09:41 last edited by
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.
-
Lifetime Qt Championwrote on 10 Apr 2020, 10:49 last edited by Christian Ehrlicher 4 Oct 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.
-
This is not even possible on the os level. When you program can read/write the file than the user can do it also.
@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. :)
2/7