Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [solved] retain value of qlineedit for next execution

    General and Desktop
    4
    5
    1614
    Loading More Posts
    • 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.
    • D
      devfeel last edited by

      Hi,
      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.

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • B
          BelenMuñoz last edited by

          As Sierdzio said, you'll have to save the last entry somewhere outside the program.

          Me casé con un enano pa jartarme de reí.

          1 Reply Last reply Reply Quote 0
          • C
            Code_ReaQtor last edited by

            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.

            Please visit my open-source projects at https://github.com/Code-ReaQtor.

            1 Reply Last reply Reply Quote 0
            • D
              devfeel last edited by

              Thanks all
              referred the following link
              http://qt-project.org/wiki/How_to_Use_QSettings

              1 Reply Last reply Reply Quote 0
              • First post
                Last post