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
Forum Updated to NodeBB v4.3 + New Features

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 26 Oct 2017, 10:41 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?

    J 1 Reply Last reply 26 Oct 2017, 11:13
    0
    • L Lasith
      26 Oct 2017, 10:41

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 26 Oct 2017, 11:13 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 1 Nov 2017, 07:01
      4
      • J jsulm
        26 Oct 2017, 11:13

        @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 1 Nov 2017, 07:01 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
        • V Offline
          V Offline
          VRonin
          wrote on 1 Nov 2017, 08:12 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

          3/4

          1 Nov 2017, 07:01

          • Login

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