[QScintilla] Editor position for a mouse event

Phil Thompson phil at riverbankcomputing.com
Fri Apr 20 13:29:40 BST 2018


On 19 Apr 2018, at 5:58 pm, Scott Bloom <scott at towel42.com> wrote:
> 
> 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.

Should be fixed in tonight's snapshot.

Phil


More information about the QScintilla mailing list