Results 1 to 4 of 4

Thread: How to store some settings without database but with sort of delete protection?

  1. #1
    Join Date
    Jan 2012
    Posts
    23
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default How to store some settings without database but with sort of delete protection?

    Hi there
    i would like to know if there is a good way to store some application settings? They have to be available even after restarting the program. So maybe i have to store an ID of something.
    If i add 1 to ID (ID is 0) then i have to be able to get ID=1 after restarting the application.
    I heard about QSettings but is it something that will suit my requirements?

    Edit: If QSettings is the right way will all stored values be still available after copying the application to another pc?



    Greetz
    Last edited by Terreox; 16th February 2012 at 18:35.

  2. #2
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to store some settings without database but with sort of delete protection?

    you are talking about the editor settings? like color identing etc?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to store some settings without database but with sort of delete protection?

    QSettings on Windows by default stores data in the registry, so transferring the application to a different machine will not transfer the settings. However QSettings can also store settings in files in which case moving the file to the other machine will make the settings available there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:

    Terreox (16th February 2012)

  5. #4
    Join Date
    Jan 2012
    Posts
    23
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to store some settings without database but with sort of delete protection?

    @KillGabio:
    No i mean some variables like GUI Settings (e.g. geometry of your GUI)

    @wysota:
    Thanks will try it out

Similar Threads

  1. Secure way to store passwords in settings file
    By Alir3z4 in forum Qt Programming
    Replies: 2
    Last Post: 27th November 2011, 12:27
  2. How store a unsigned short into a database
    By franco.amato in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2011, 22:17
  3. Need ideas on how to store data in SQL-Database
    By homerun4711 in forum Newbie
    Replies: 3
    Last Post: 5th January 2011, 23:10
  4. Replies: 0
    Last Post: 25th April 2010, 17:41
  5. Is it possible to store pointers in a database ?
    By probine in forum General Programming
    Replies: 8
    Last Post: 5th April 2006, 21:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.