0

I am using qtcreator locking for a way to save my data if i restart my app it continue from last value not restart to 0 its only part of the code

void Form::on_pushButton_clicked()
{
    counter++;
}
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • 1
    You could use a text file or depending on your use case QSettings: [https://doc.qt.io/qt-5/qsettings.html](https://doc.qt.io/qt-5/qsettings.html) – drescherjm Nov 25 '20 at 19:16

1 Answers1

1

You can either save it to a file of your choice: Writing Integers to a .txt file in c++

Or you can use Qt Settings file: https://doc.qt.io/qt-5/qsettings.html

Or if you start to have more information and you also what to save relationships between your data, you can start looking at Databases. A simple and local DBMS is Sqlite: https://www.sqlite.org/index.html

Luca Angioloni
  • 2,243
  • 2
  • 19
  • 28