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. Storing previously entered words in cache
QtWS25 Last Chance

Storing previously entered words in cache

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcreatorline editusernamecaching
4 Posts 3 Posters 1.2k Views
  • 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.
  • L Offline
    L Offline
    Lasith
    wrote on last edited by
    #1

    In my Qt Desktop app there is a login form! The user has to enter the Username and password to login to the app! The login is working but I want to store the previously entered usernames so that when next time I open the app and enter first letter of a user name the list of user names starting with that letter(which had previously been entered) should appear! How can I achieve this?

    jsulmJ 1 Reply Last reply
    0
    • L Lasith

      In my Qt Desktop app there is a login form! The user has to enter the Username and password to login to the app! The login is working but I want to store the previously entered usernames so that when next time I open the app and enter first letter of a user name the list of user names starting with that letter(which had previously been entered) should appear! How can I achieve this?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Lasith Just write the entered words in a file. When the app later starts it reads the file. Then, depending on what you use to enter username you can use http://doc.qt.io/qt-5/qlineedit.html#setCompleter

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      4
      • jsulmJ jsulm

        @Lasith Just write the entered words in a file. When the app later starts it reads the file. Then, depending on what you use to enter username you can use http://doc.qt.io/qt-5/qlineedit.html#setCompleter

        L Offline
        L Offline
        Lasith
        wrote on last edited by
        #3

        @jsulm Thanx but if we consider something like a search text box how can we get the list of words without keeping them in a text file?

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Store a QStringList in QSettings and pass it to a QStringListModel and then to the completer, maybe

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          2

          • Login

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