[QScintilla] Editor position for a mouse event
Scott Bloom
scott at towel42.com
Thu Apr 19 17:58:21 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
================
I don't think its necessary... However, I think the real issue, is the RMB doesn't move the cursor..
In a "quick" survey of the editors on my desktop, Lemmy did, notepad didn't, visual studio does, as does Sigasi.
In the onContextEvent, I simply move the caret and all is well from that point forward.
Scott
More information about the QScintilla
mailing list