[Solved] How to skip fast keystroke in search?
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"
Do you really want to search when enter characters ? Or you just want searching after enter the whole word ?
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"
Ok, i see. I think you can take followed things into consideration:
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"
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
Yes, I want second timer example for that.
If timer out, "Termi" will be searched...
The problem is where can I set that timer?
andre last edited by
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 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 !