[QScintilla] showing ToolTips dinamically

Andrea Battisti battisti at actgate.com
Wed Nov 5 22:50:42 GMT 2008


Hi All,

is it possible to pop-up a tooltip within a QSciScintilla editor widget?

I was thinking to use the QToolTip class from Qt to draw a tooltip
dinamically, based on the current mouse position.

The problem is that the ToolTip needs to be associated to a rectangle
within the widget, and I am not seeing a way to go from the mouse
position to the word under the cursor.

I checked the QScintilla API docs and I only found the lineAt( QPoint& )
method that gives back the line where the cursor is pointing at.
Is there a way to find also the word? (the column positions?)
And is there a way then to get the QRect corresponding to that specific
word?

For example, a use case would be the following: when the mouse is held
for a second or two over a word, then a pop-up could appear showing
context-specific information on that word.


Thanks in advance,

-- 
Andrea Battisti
Applied Coherent Technology Corp.



More information about the QScintilla mailing list