org.kde.koala

Class KCursor

public class KCursor extends Qt

A wrapper around QCursor that allows for "themed" cursors. Currently, the only themed cursor is a hand shaped cursor. A typical usage would be
 setCursor(KCursor.handCursor());
 

Author: Kurt Granroth

UNKNOWN: A QCursor wrapper allowing "themed" cursors and auto-hiding cursors.

Constructor Summary
protected KCursor(Class dummy)
KCursor()
Constructor.
Method Summary
static QCursorarrowCursor()
Returns the proper arrow cursor according to the current GUI style (static function).
static voidautoHideEventFilter(QObject arg1, QEvent arg2)
KCursor has to install an eventFilter over the widget you want to auto-hide.
static QCursorblankCursor()
Returns a blank or invisible cursor (static function).
static QCursorcrossCursor()
Returns the proper cross-hair cursor according to the current GUI style (static function).
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
static QCursorhandCursor()
Returns the proper hand cursor according to the current GUI style (static function).
static inthideCursorDelay()
Default is 5000, i.e.
static QCursoribeamCursor()
Returns the proper text cursor according to the current GUI style (static function).
booleanisDisposed()
Has the wrapped C++ instance been deleted?
static voidsetAutoHideCursor(QWidget w, boolean enable)
Sets auto-hiding the cursor for widget w. 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.
    static voidsetAutoHideCursor(QWidget w, boolean enable, boolean customEventFilter)
    Overloaded method for the case where you have an event-filter installed on the widget you want to enable auto-cursor-hiding.
    static voidsetHideCursorDelay(int ms)
    Sets the delay time in milliseconds for auto-hiding.
    static QCursorsizeAllCursor()
    Returns the proper all-directions resize cursor according to the current GUI style (static function).
    static QCursorsizeBDiagCursor()
    Returns the proper diagonal resize (/) cursor according to the current GUI style (static function).
    static QCursorsizeFDiagCursor()
    Returns the proper diagonal resize (\) cursor according to the current GUI style (static function).
    static QCursorsizeHorCursor()
    Returns the proper horizontal resize cursor according to the current GUI style (static function).
    static QCursorsizeVerCursor()
    Returns the proper vertical resize cursor according to the current GUI style (static function).
    static QCursorupArrowCursor()
    Returns the proper up arrow cursor according to the current GUI style (static function).
    static QCursorwaitCursor()
    Returns the proper hourglass cursor according to the current GUI style (static function).
    static QCursorwhatsThisCursor()
    Returns a WhatsThis cursor (static function).
    static QCursorworkingCursor()
    Returns the proper arrow+hourglass cursor according to the current GUI style (static function).

    Constructor Detail

    KCursor

    protected KCursor(Class dummy)

    KCursor

    public KCursor()
    Constructor. Does not do anything so far.

    UNKNOWN: Constructor.

    Method Detail

    arrowCursor

    public static QCursor arrowCursor()
    Returns the proper arrow cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper arrow cursor according to the current GUI style (static function).

    autoHideEventFilter

    public static void autoHideEventFilter(QObject arg1, QEvent arg2)
    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:
    		 edit = new KEdit( this, "some edit widget" );
    		 edit.installEventFilter( this );
    		 KCursor.setAutoHideCursor( edit, true, true );
    			 [...]
    			 boolean YourClass.eventFilter( QObject o, QEvent e )
    		 {
    		     if ( o == edit ) // only that widget where you enabled auto-hide!
    		         KCursor.autoHideEventFilter( o, e );
    			     // now you can do your own event-processing
    		     [...]
    		 }
    		 
    Note that you must not call KCursor.autoHideEventFilter() when you didn't enable or after disabling auto-hiding.

    UNKNOWN: KCursor has to install an eventFilter over the widget you want to auto-hide.

    blankCursor

    public static QCursor blankCursor()
    Returns a blank or invisible cursor (static function).

    UNKNOWN: Returns a blank or invisible cursor (static function).

    crossCursor

    public static QCursor crossCursor()
    Returns the proper cross-hair cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper cross-hair cursor according to the current GUI style (static function).

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    handCursor

    public static QCursor handCursor()
    Returns the proper hand cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper hand cursor according to the current GUI style (static function).

    hideCursorDelay

    public static int hideCursorDelay()
    Default is 5000, i.e. 5 seconds.

    Returns: the current auto-hide delay time.

    UNKNOWN:

    ibeamCursor

    public static QCursor ibeamCursor()
    Returns the proper text cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper text cursor according to the current GUI style (static function).

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    setAutoHideCursor

    public static void setAutoHideCursor(QWidget w, boolean enable)
    Sets auto-hiding the cursor for widget w. 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().

    UNKNOWN: Sets auto-hiding the cursor for widget w.

    setAutoHideCursor

    public static void setAutoHideCursor(QWidget w, boolean enable, boolean customEventFilter)
    Overloaded method for the case where you have an event-filter installed on the widget you want to enable auto-cursor-hiding. In this case set customEventFilter to true and call autoHideEventFilter() from the beginning of your eventFilter().

    See Also: KCursor

    UNKNOWN: Overloaded method for the case where you have an event-filter installed on the widget you want to enable auto-cursor-hiding.

    setHideCursorDelay

    public static void setHideCursorDelay(int ms)
    Sets the delay time in milliseconds for auto-hiding. When no keyboard events arrive for that time-frame, the cursor will be hidden. Default is 5000, i.e. 5 seconds.

    UNKNOWN: Sets the delay time in milliseconds for auto-hiding.

    sizeAllCursor

    public static QCursor sizeAllCursor()
    Returns the proper all-directions resize cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper all-directions resize cursor according to the current GUI style (static function).

    sizeBDiagCursor

    public static QCursor sizeBDiagCursor()
    Returns the proper diagonal resize (/) cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper diagonal resize (/) cursor according to the current GUI style (static function).

    sizeFDiagCursor

    public static QCursor sizeFDiagCursor()
    Returns the proper diagonal resize (\) cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper diagonal resize (\) cursor according to the current GUI style (static function).

    sizeHorCursor

    public static QCursor sizeHorCursor()
    Returns the proper horizontal resize cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper horizontal resize cursor according to the current GUI style (static function).

    sizeVerCursor

    public static QCursor sizeVerCursor()
    Returns the proper vertical resize cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper vertical resize cursor according to the current GUI style (static function).

    upArrowCursor

    public static QCursor upArrowCursor()
    Returns the proper up arrow cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper up arrow cursor according to the current GUI style (static function).

    waitCursor

    public static QCursor waitCursor()
    Returns the proper hourglass cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper hourglass cursor according to the current GUI style (static function).

    whatsThisCursor

    public static QCursor whatsThisCursor()
    Returns a WhatsThis cursor (static function).

    UNKNOWN: Returns a WhatsThis cursor (static function).

    workingCursor

    public static QCursor workingCursor()
    Returns the proper arrow+hourglass cursor according to the current GUI style (static function).

    UNKNOWN: Returns the proper arrow+hourglass cursor according to the current GUI style (static function).