|static void||autoHideEventFilter (QObject *, QEvent *)|
|static int||hideCursorDelay ()|
|static void||setAutoHideCursor (QWidget *w, bool enable, bool customEventFilter=false)|
|static void||setHideCursorDelay (int ms)|
The KCursor class provides a set of static convenience methods for auto-hiding cursors on widgets.
Member Function Documentation
KCursor has to install an eventFilter over the widget you want to auto-hide.
If you have an own eventFilter() on that widget and stop some events by returning true, you might break auto-hiding, because KCursor doesn't get those events.
In this case, you need to call setAutoHideCursor( widget, true, true ); to tell KCursor not to install an eventFilter. Then you call this method from the beginning of your eventFilter, for example:
Note that you must not call KCursor::autoHideEventFilter() when you didn't enable or after disabling auto-hiding.
Sets auto-hiding the cursor for widget
Enabling it will result in the cursor being hidden when
- a key-event happens
- there are no key-events for a configured time-frame (see setHideCursorDelay())
The cursor will be shown again when the focus is lost or a mouse-event happens.
Side effect: when enabling auto-hide, mouseTracking is enabled for the specified widget, because it's needed to get mouse-move-events. So don't disable mouseTracking for a widget while using auto-hide for it.
When disabling auto-hide, mouseTracking will be disabled, so if you need mouseTracking after disabling auto-hide, you have to reenable mouseTracking.
If you want to use auto-hiding for widgets that don't take focus, e.g. a QCanvasView, then you have to pass all key-events that should trigger auto-hiding to autoHideEventFilter().
The documentation for this class was generated from the following files: