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] How to skip fast keystroke in search?
Forum Updated to NodeBB v4.3 + New Features

[Solved] How to skip fast keystroke in search?

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.6k 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.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    Dear all,

    @ connect(QLineEdit,SIGNAL(textChanged(QString)),this,SLOT(FindWord(QString)));@

    In every textChanged in QLineEdit, it calls slot FindWord.
    How can I skip rapid keystrokes with timer to eliminate unnecessary search? e.g, in long word search "Termination"

    Thanks

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chuck Gao
      wrote on last edited by
      #2

      Do you really want to search when enter characters ? Or you just want searching after enter the whole word ?

      Chuck

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zither
        wrote on last edited by
        #3

        I would like to search when enter characters but skip keystrokes that long just 1s between them.
        I means I don't want to search unnecessary words in "T", "Te", "Ter", "Term", "Termi", etc...
        in full word "Termination"

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chuck Gao
          wrote on last edited by
          #4

          Ok, i see. I think you can take followed things into consideration:

          1. Do your search under 2 senarios. The first one is when you press "Return" key on keyboard, or search button on your application, the second one is after your Timer's time out(1s etc). But please notice that, the second one maybe not what you want, for example, when you type "Termi" and the times out, the app will still searching for unnecessary words "Termi"

          2. Use auto completer to complete the word you are typing. Just searching the full word in your completer array when times out or follow 1's first senario, searching when "Return" pressed

          Hope it'll help :D

          Chuck

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            zither
            wrote on last edited by
            #5

            Yes, I want second timer example for that.

            If timer out, "Termi" will be searched...

            The problem is where can I set that timer?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              I wrote a "wiki article":http://developer.qt.nokia.com/wiki/Delay_action_to_wait_for_user_interaction on this. You might want to take a look at it.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Chuck Gao
                wrote on last edited by
                #7

                [quote author="Andre" date="1312046102"]I wrote a "wiki article":http://developer.qt.nokia.com/wiki/Delay_action_to_wait_for_user_interaction on this. You might want to take a look at it. [/quote]

                Thank you Andre !

                Chuck

                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