Buttons work well. I can create and fill my list - ProfileList e.g. ("1","2","3","4"). When I rerun the program there is LoadProfile function, which loads exactly the same list, but when I push AddProfileButton, it creates new List with newly added element at start, deleting previous records and values entirely. Can you explain me why?
In MainWindow.cpp
LoadProfileList();
QSettings settings("MichaU", "BeingFit");
QStringList ProfileList;
LoadProfileList();
To copy to clipboard, switch view to plain text mode
SaveProfile() Function:
ProfileList.append(ui->CreateProfile->text()); //my lineEdit
settings.setValue("ProfileList", ProfileList);
qDebug() << "Settings Saved:" << ProfileList;
QSettings settings("MichaU", "BeingFit");
ProfileList.append(ui->CreateProfile->text()); //my lineEdit
settings.setValue("ProfileList", ProfileList);
qDebug() << "Settings Saved:" << ProfileList;
To copy to clipboard, switch view to plain text mode
LoadProfile() Function:
settings.value("ProfileList").toStringList();
qDebug() << "Settings Loaded:" << settings.value("ProfileList").toStringList();
QSettings settings("MichaU", "BeingFit");
settings.value("ProfileList").toStringList();
qDebug() << "Settings Loaded:" << settings.value("ProfileList").toStringList();
To copy to clipboard, switch view to plain text mode
It should be working, I dont know why it clears the list every time. Any Ideas?
Bookmarks