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.