Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] retain value of qlineedit for next execution
Forum Updated to NodeBB v4.3 + New Features

[solved] retain value of qlineedit for next execution

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.0k Views 1 Watching
  • 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 Offline
    D Offline
    devfeel
    wrote on last edited by
    #1

    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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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
      0
      • B Offline
        B Offline
        BelenMuñoz
        wrote on last edited by
        #3

        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
        0
        • C Offline
          C Offline
          Code_ReaQtor
          wrote on last edited by
          #4

          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
          0
          • D Offline
            D Offline
            devfeel
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved