Margin mouse hover / tooltip?

Matic Kukovec kukovecmatic at hotmail.com
Tue Nov 8 13:48:57 GMT 2022


Excellent, thanks Detlev!


________________________________
From: Detlev Offenbach
Sent: Tuesday, November 8, 2022 2:46 PM
To: Matic Kukovec; Baz Walter; qscintilla at riverbankcomputing.com
Subject: Re: Margin mouse hover / tooltip?


Hi,


I realize this receipe in the eric code editor for the context menu event already. You may have a look at https://hg.die-offenbachs.homelinux.org/eric/file/tip/src/eric7/QScintilla/Editor.py lines 5594 and following.


Regards,
Detlev


Am 08.11.22 um 14:43 schrieb Matic Kukovec:
Very good! Thanks Baz
________________________________
From: Baz Walter <bazwal at gmail.com><mailto:bazwal at gmail.com>
Sent: Tuesday, November 8, 2022 2:34 PM
To: qscintilla at riverbankcomputing.com<mailto:qscintilla at riverbankcomputing.com> <qscintilla at riverbankcomputing.com><mailto:qscintilla at riverbankcomputing.com>
Subject: Re: Margin mouse hover / tooltip?

On 08/11/2022 09:27, Matic Kukovec wrote:
> Does anybody know if it's possible to catch a "MouseMove" or "ToolTip" event on a margin and knowing it's on a margin?
> I am adding markers to a margin and would like to display a tooltip or statustip for the markers on mouse hover.

I don't think there's any built-in tooltip events for margins. However, you can reimplement mouseMoveEvent and get the
line number with QsciScintilla.lineAt(event.pos()) whilst hovering on the margins. The margin number can be determined
by comparing the margin widths with event.x(). The current margin count can be determined with QsciScintilla.margin(),
and the width of each margin with QsciScintilla.marginWidth(index). By default, there are five margins. Hidden margins
have zero width.


--
Detlev Offenbach
detlev at die-offenbachs.de<mailto:detlev at die-offenbachs.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20221108/b189d859/attachment.htm>


More information about the QScintilla mailing list