Margin mouse hover / tooltip?
Baz Walter
bazwal at gmail.com
Tue Nov 8 13:34:49 GMT 2022
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.
More information about the QScintilla
mailing list