[solved] retain value of qlineedit for next execution
I have created a simple login form . I want give user a option of selecting previously used ID upon his next vist.
Consider I open the login form and enter "XYZ" in userid box. It will take me to next form upon providing correct credentials. I will close application.
When I reopen it should give me previously entered user id i.e xyz in userid textbox. Please guide me in achieving this.
Use "QSettings":http://qt-project.org/doc/qt-4.8/qsettings.html or write your own config file. If you are using a database, you can also store recent entries there.
As Sierdzio said, you'll have to save the last entry somewhere outside the program.
As stated, you may use "QSettings":http://qt-project.org/doc/qt-4.8/qsettings.html + "QLineEdit::setCompleter()":http://doc-snapshot.qt-project.org/4.8/qlineedit.html#setCompleter especially when there are multiple users and/or the user has multiple account for logging in.
referred the following link