June 29, 2011

amban amban
Lab Rat
76 posts

Adding ‘Next’ and ‘Previous’ functionality to search engine

 

Hi,
Following this example here http://doc.qt.nokia.com/main-snapshot/uitools-textfinder.html to find matching strings. Now I have added a ‘Next’ and ‘Previous’ button to choose one searched result at a time. Can anyone point out Qt code to achieve this. I am not sure how to proceed.

Thanks

6 replies

June 29, 2011

koahnig koahnig
Gene Splicer
2901 posts

Probably you should elaborate a little more what you are trying to achieve.
The textfinder example is pretty obvious, but that is apparently not your question.

June 29, 2011

amban amban
Lab Rat
76 posts

Hi,
What i want to achieve is that once all the searched strings have been highlighted (as in textfinder example), I want to use keys ‘p’ and ‘n’ to browse through the selected strings . Something like using ‘n’ key to browse through results in vi grep command.

Thanks

June 30, 2011

amban amban
Lab Rat
76 posts

Hi, I have not been able to find the solution. Any help is appreciated.

June 30, 2011

Volker Volker
Ant Farmer
5428 posts

Did you try adding a QAction with a shortcut and connect that to a slot?

July 6, 2011

amban amban
Lab Rat
76 posts

I have edited the title…any help ?

July 6, 2011

Gerolf Gerolf
Robot Herder
3253 posts
Volker wrote:
Did you try adding a QAction with a shortcut and connect that to a slot?

This is the solution. Add two new buttons, connect them to slots and to the same as in find, only that you use the current cursor position as start position.

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

 
  ‹‹ [SOLVED] Set Scroll Per Item      Spell checker? ››

You must log in to post a reply. Not a member yet? Register here!