Can I get a line of code that saves text of QLineedit and on restarting the app , it is retrieved ? Please help , its very important for my project …
Asked
Active
Viewed 4,106 times
-2
-
2Did you even tried it by yourself? – Mar 20 '13 at 09:42
1 Answers
1
//read
QSettings settings("settingName");
QString aValue=settings.value("aKey").toString();
//write
QSettings settings("settingName");
QString somevalue=textedit.text();
settings.setValue("aKey",somevalue);

Luca Rocchi
- 6,272
- 1
- 23
- 23
-
1Furthermore, the read can be in the ctor of your QMainWindow (or in general, QWidget) and the write in your reimplementation of QWidget::closeEvent(QCloseEvent*) in the QWidget or derivate. – Manjabes Mar 20 '13 at 08:36