Qt World Summit: Register Today!

Get the word when mouse cursor is hovering over it

  • how to get the word when mouse cursor is hovering over it ?

    for example ,when pointing the mouse at the word “signal” ,I should get the word “signal” . how to implement this ? any ideas ?

    system : Ubuntu

  • Supposing your text is displayed in a label or so you get the position on this label and with QFontMetrics you can calculate the metrics of this text to get the position of single words.
    If you have a label only containing "signal" it is enough to know that you are hovering the label.

  • no widget specific here.

  • And now we should guess where you are hovering over and where the text comes from?

    Lets try another example: Make a screenshot, use OCR, find your cursor and there we go.

  • the word could be in any place of a screen , a web page ,a PDF page and so on .I just want to find a generic way to get the world the mouse cursor pointing at .
    I also thought of OCR ,but this technology is not mature enough !

Log in to reply