Find the answer to your Linux question:
Results 1 to 8 of 8
Hello guys , I'm doing a small project under Kde using Qt Framework can Any one give me a hint or tell me How to retrieve text under the cursor ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Location
    Saudi Arabia
    Posts
    5

    How to retrieve text under the cursor (mouse pointer).


    Hello guys ,
    I'm doing a small project under Kde using Qt Framework can Any one give me a hint or tell me How to retrieve text under the cursor (mouse pointer). It's not problem if there is no Qt API that does this , Any API will work ...
    Best regard
    Abdulla Alwabel

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    What do you mean by text under the cursor? Do you mean like highlighted text or what?

  3. #3
    Linux User Stefann's Avatar
    Join Date
    Nov 2004
    Location
    Boise, ID
    Posts
    340
    Quote Originally Posted by lakerdonald
    What do you mean by text under the cursor? Do you mean like highlighted text or what?
    I would assume so...
    Nothing is worse than ten penguins fighting over which is better, vi or emacs.
    Registered Linux User #404402
    Finally I'm back on LF after a long while.

  4. #4
    Just Joined!
    Join Date
    Oct 2005
    Location
    Saudi Arabia
    Posts
    5
    Yah I meant the highlited text , so if you are using the browser or any program then you highlight a text or just point to it , I want to retreive it

    Thanx for respoding quickley

  5. #5
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,864
    If you're rendering the text yourself, there is nothing to stop you building up a map or array with the co-ordinates of each bit of text in it, then whizzing down the array or map with the mouse co-ords when it moves. You then know what you're pointing at and its co-ords, so you can even re-draw (different colour/typeface, add underlining, etc) to highlight the text.
    Linux user #126863 - see http://linuxcounter.net/

  6. #6
    Just Joined!
    Join Date
    Oct 2005
    Location
    Saudi Arabia
    Posts
    5
    Tannk you Roxoff for you respoding
    I think that you didn't understand my idea, My idea is when the user highlight then click or even not then my program appear and translate this text

  7. #7
    Linux User
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    401

    Stardict

    Actually I know stardict do translation of selected/pointed text. because it's open source you can study its code to get some usefull routine.... it is based on Gtk widgets, but it should work with everything!

    If you use debian: apt-get source stardict
    When using Windows, have you ever told "Ehi... do your business?"
    Linux user #396597 (http://counter.li.org)

  8. #8
    Just Joined!
    Join Date
    Oct 2005
    Location
    Saudi Arabia
    Posts
    5
    Thank you very very much ... There is a dictionary which is similar than stardict but it was written using Qt it's cuteDict
    Thank you burnit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •