[Solved] How to skip fast keystroke in search?
-
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
-
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
-
-
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 !