auto-hide feature in KTextEdit does not shown the mouse pointer again on mouse moves

Nico Kruber Nico.Laus.2001 at
Mon Aug 6 20:50:05 BST 2007

I noticed that once the mouse pointer is hidden within a KTextEdit it is not 
shown again by moving the mouse alone as it was described and should probably 
I tried to look into this and figured that mouse events in a QTextEdit are 
handled by its viewport and send to the specific QTextEdit::mouseMoveEvent() 
etc. methods but not processed any further so installing an event filter on 
the KTextEdit does not get the mouse events. Installing it on its viewport 
does not help either because this one does not get key events so the cursor 
is not hidden by them.
I tried reimplementing the viewportEvent() method and call 
KCursor::autoHideEventFilter() manually from there but this method always 
complained about that an event filter was not applied yet ( there probably is 
already an event before the "KCursor::setAutoHideCursor( this, true, 
false );" in the constructors ).

My final fix was to install an event filter on the viewport and call it from 
there. I put the eventfilter() method into the KTextEdit class - probably not 
the right way you want it to be, but I don't know where else without creating 
a new class which kinda seems unnecessary for one method.

I hope this helps resolving this issue - there might be more classes which 
need that modification in order to get the auto-hide function working - and I 
also hope I got the right mailing list.

Nico Kruber
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ktextedit.diff
Type: text/x-diff
Size: 1548 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list