[QScintilla] Editor position for a mouse event

Phil Thompson phil at riverbankcomputing.com
Thu Apr 19 17:07:55 BST 2018


On 18 Apr 2018, at 1:55 am, Scott Bloom <scott at towel42.com> wrote:
> 
> Currently, when the user clicks the context mouse button (right mouse button typically), the caret does not move to the position.
>  
> Im assuming this is intentional, however the extended context help that I need to give, is based on the location of the mouse, not the cursor
>  
> How can I get the line/index for a given QContextMenuEvent * event?

You can use SCI_POSITIONFROMPOINTCLOSE (see the implementation of lineAt() and then pass the result to lineIndexFromPosition().

I could add a lineIndexAt().

Phil


More information about the QScintilla mailing list