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. c++ QSetting for store system date

c++ QSetting for store system date

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 678 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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by
    #1

    My project ... a sort of timeout for control if app run more than 8 mounth for example .... at every run read the past saved data from a QSetting group called "dataControl" .... than

    if there are less than 2 day difference from actual data, I store the new date on QSetting group "dataControl" ...
    than I control the "startingdata" from QSetting group "startingdata" ...
    if the difference from "startingdata" is more than 8 mounth I stop the app
    if less nothing to do.
    else QSetting group "dataControl" is more than 2 I send a messages "someone have modified system data" and stop the app.

    my problem the app maybe run for 10 years or more .... every date that I stored onto Qsetting group required some spaces ... there are a system to delete the oldest data saved on QSettings and saved only the newest? (maybe not uderstand very well the QSetting woking mode .... as I understand basically it is a database ... and every group is only a data table ... is wrong these??)

    regards
    Giorgio

    bkt

    mrjjM 1 Reply Last reply
    0
    • gfxxG gfxx

      My project ... a sort of timeout for control if app run more than 8 mounth for example .... at every run read the past saved data from a QSetting group called "dataControl" .... than

      if there are less than 2 day difference from actual data, I store the new date on QSetting group "dataControl" ...
      than I control the "startingdata" from QSetting group "startingdata" ...
      if the difference from "startingdata" is more than 8 mounth I stop the app
      if less nothing to do.
      else QSetting group "dataControl" is more than 2 I send a messages "someone have modified system data" and stop the app.

      my problem the app maybe run for 10 years or more .... every date that I stored onto Qsetting group required some spaces ... there are a system to delete the oldest data saved on QSettings and saved only the newest? (maybe not uderstand very well the QSetting woking mode .... as I understand basically it is a database ... and every group is only a data table ... is wrong these??)

      regards
      Giorgio

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @gfxx
      Hi
      QSettings is really not a database as such.
      On windows, it stores the values in registry on linux
      in a (text) ini file. Can also save to ini on windows.
      The is no algorithm to remove old ones or anything like that.
      However, you can do that manually.
      If app is to live 10 years saving to registry seems not like
      a good solution as windows might get wiped/reinstalled.

      Why not use QT SQL real database for it ?
      It can easy handled GB of data if enough disk space and
      you can use SQL to find and remove older entries.
      http://blog.davidecoppola.com/2016/11/howto-embed-database-in-application-with-sqlite-and-qt/

      gfxxG 1 Reply Last reply
      3
      • mrjjM mrjj

        @gfxx
        Hi
        QSettings is really not a database as such.
        On windows, it stores the values in registry on linux
        in a (text) ini file. Can also save to ini on windows.
        The is no algorithm to remove old ones or anything like that.
        However, you can do that manually.
        If app is to live 10 years saving to registry seems not like
        a good solution as windows might get wiped/reinstalled.

        Why not use QT SQL real database for it ?
        It can easy handled GB of data if enough disk space and
        you can use SQL to find and remove older entries.
        http://blog.davidecoppola.com/2016/11/howto-embed-database-in-application-with-sqlite-and-qt/

        gfxxG Offline
        gfxxG Offline
        gfxx
        wrote on last edited by
        #3

        @mrjj thnks ... I already use with success sqlite database ... in these case i need to protect the data with some program ... I'm on linux and normally I make a custom minimal install ... so system never update requirement to user ... ok I make in these way ... there are some system to connect qt app with a database encription for protect table data from change?

        regards
        Giorgio

        bkt

        mrjjM 1 Reply Last reply
        0
        • gfxxG gfxx

          @mrjj thnks ... I already use with success sqlite database ... in these case i need to protect the data with some program ... I'm on linux and normally I make a custom minimal install ... so system never update requirement to user ... ok I make in these way ... there are some system to connect qt app with a database encription for protect table data from change?

          regards
          Giorgio

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @gfxx
          Hi
          Yes sqlite supports encryption
          https://www.zetetic.net/sqlcipher/
          To use it free, u have to build it yourself.
          I think this also works
          https://github.com/rindeal/SQLite3-Encryption

          If you google, there are other options too.

          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