Qt Move textcursor to right click point

Hi all,

I'm making a simple text editor with qt. At the moment I have a standard context menu which appears upon right-clicking . I need it so that as soon as this right click occurs the text cursor moves to the nearest position (i.e. between two chars) to that click. This would allow me to identify an event specific to a word so the rightclick->menu works properly.

How do I do this?

Thanks in advance.
Last edited on
And the answer is QTextEdit:: cursorForPosition.
Topic archived. No new replies allowed.