.TH "KCursor" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCursor \- A wrapper around \fBQCursor\fP that allows for 'themed' cursors. A \fBQCursor\fP wrapper allowing 'themed' cursors and auto-hiding cursors.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcursor.h>\fP
.PP
Inherits \fBQt\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKCursor\fP ()"
.br
.RI "\fIConstructor. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQCursor\fP \fBhandCursor\fP ()"
.br
.RI "\fIReturns the proper hand cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBworkingCursor\fP ()"
.br
.RI "\fIReturns the proper arrow+hourglass cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBarrowCursor\fP ()"
.br
.RI "\fIReturns the proper arrow cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBupArrowCursor\fP ()"
.br
.RI "\fIReturns the proper up arrow cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBcrossCursor\fP ()"
.br
.RI "\fIReturns the proper cross-hair cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBwaitCursor\fP ()"
.br
.RI "\fIReturns the proper hourglass cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBibeamCursor\fP ()"
.br
.RI "\fIReturns the proper text cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBsizeVerCursor\fP ()"
.br
.RI "\fIReturns the proper vertical resize cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBsizeHorCursor\fP ()"
.br
.RI "\fIReturns the proper horizontal resize cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBsizeBDiagCursor\fP ()"
.br
.RI "\fIReturns the proper diagonal resize (/) cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBsizeFDiagCursor\fP ()"
.br
.RI "\fIReturns the proper diagonal resize (\\) cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBsizeAllCursor\fP ()"
.br
.RI "\fIReturns the proper all-directions resize cursor according to the current GUI style (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBblankCursor\fP ()"
.br
.RI "\fIReturns a blank or invisible cursor (static function). \fP"
.ti -1c
.RI "\fBQCursor\fP \fBwhatsThisCursor\fP ()"
.br
.RI "\fIReturns a WhatsThis cursor (static function). \fP"
.ti -1c
.RI "void \fBsetAutoHideCursor\fP (\fBQWidget\fP *w, bool enable)"
.br
.RI "\fISets auto-hiding the cursor for widget \fCw\fP. \fP"
.ti -1c
.RI "void \fBsetAutoHideCursor\fP (\fBQWidget\fP *w, bool enable, bool customEventFilter)"
.br
.RI "\fIOverloaded method for the case where you have an event-filter installed on the widget you want to enable auto-cursor-hiding. \fP"
.ti -1c
.RI "void \fBsetHideCursorDelay\fP (int ms)"
.br
.RI "\fISets the delay time in milliseconds for auto-hiding. \fP"
.ti -1c
.RI "int \fBhideCursorDelay\fP ()"
.br
.ti -1c
.RI "void \fBautoHideEventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.RI "\fIKCursor has to install an eventFilter over the widget you want to auto-hide. \fP"
.in -1c
.SH "Detailed Description"
.PP 
A wrapper around \fBQCursor\fP that allows for 'themed' cursors. A \fBQCursor\fP wrapper allowing 'themed' cursors and auto-hiding cursors. 

Currently, the only themed cursor is a hand shaped cursor.
.PP
A typical usage would be 
.PP
.nf

 	setCursor(\fBKCursor::handCursor()\fP);
 
.PP
.PP
\fBAuthor:\fP
.RS 4
Kurt Granroth <granroth@kde.org> 
.RE
.PP

.PP
Definition at line 43 of file kcursor.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCursor::KCursor ()"
.PP
Constructor. Does not do anything so far. Definition at line 40 of file kcursor.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQCursor\fP KCursor::handCursor ()\fC [static]\fP"
.PP
Returns the proper hand cursor according to the current GUI style (static function). Definition at line 44 of file kcursor.cpp.
.PP
References KGlobal::config(), QCursor::handle(), and KConfigBase::readEntry().
.PP
Referenced by KListView::contentsMouseMoveEvent(), KURLLabel::KURLLabel(), KURLLabel::setUseCursor(), and KTextBrowser::viewportMouseMoveEvent().
.SS "\fBQCursor\fP KCursor::workingCursor ()\fC [static]\fP"
.PP
Returns the proper arrow+hourglass cursor according to the current GUI style (static function). Definition at line 124 of file kcursor.cpp.
.PP
References QCursor::handle().
.SS "\fBQCursor\fP KCursor::arrowCursor ()\fC [static]\fP"
.PP
Returns the proper arrow cursor according to the current GUI style (static function). This will change at some later date Definition at line 145 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::upArrowCursor ()\fC [static]\fP"
.PP
Returns the proper up arrow cursor according to the current GUI style (static function). Definition at line 151 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::crossCursor ()\fC [static]\fP"
.PP
Returns the proper cross-hair cursor according to the current GUI style (static function). Definition at line 157 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::waitCursor ()\fC [static]\fP"
.PP
Returns the proper hourglass cursor according to the current GUI style (static function). Definition at line 163 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::ibeamCursor ()\fC [static]\fP"
.PP
Returns the proper text cursor according to the current GUI style (static function). Definition at line 169 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::sizeVerCursor ()\fC [static]\fP"
.PP
Returns the proper vertical resize cursor according to the current GUI style (static function). Definition at line 175 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::sizeHorCursor ()\fC [static]\fP"
.PP
Returns the proper horizontal resize cursor according to the current GUI style (static function). Definition at line 181 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::sizeBDiagCursor ()\fC [static]\fP"
.PP
Returns the proper diagonal resize (/) cursor according to the current GUI style (static function). Definition at line 187 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::sizeFDiagCursor ()\fC [static]\fP"
.PP
Returns the proper diagonal resize (\\) cursor according to the current GUI style (static function). Definition at line 193 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::sizeAllCursor ()\fC [static]\fP"
.PP
Returns the proper all-directions resize cursor according to the current GUI style (static function). Definition at line 199 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::blankCursor ()\fC [static]\fP"
.PP
Returns a blank or invisible cursor (static function). Definition at line 205 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::whatsThisCursor ()\fC [static]\fP"
.PP
Returns a WhatsThis cursor (static function). Definition at line 210 of file kcursor.cpp.
.SS "void KCursor::setAutoHideCursor (\fBQWidget\fP * w, bool enable)\fC [static]\fP"
.PP
Sets auto-hiding the cursor for widget \fCw\fP. Enabling it will result in the cursor being hidden when 
.IP "\(bu" 2
a key-event happens 
.IP "\(bu" 2
there are no key-events for a configured time-frame (see \fBsetHideCursorDelay\fP())
.PP
The cursor will be shown again when the focus is lost or a mouse-event happens.
.PP
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.
.PP
When disabling auto-hide, mouseTracking will be disabled, so if you need mouseTracking after disabling auto-hide, you have to reenable mouseTracking.
.PP
If you want to use auto-hiding for widgets that don't take focus, e.g. a \fBQCanvasView\fP, then you have to pass all key-events that should trigger auto-hiding to \fBautoHideEventFilter\fP(). Definition at line 217 of file kcursor.cpp.
.PP
Referenced by KLineEdit::create(), KEdit::create(), KComboBox::create(), KEdit::KEdit(), and KTextEdit::KTextEdit().
.SS "void KCursor::setAutoHideCursor (\fBQWidget\fP * w, bool enable, bool customEventFilter)\fC [static]\fP"
.PP
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 \fCcustomEventFilter\fP to true and call \fBautoHideEventFilter\fP() from the beginning of your eventFilter().
.PP
\fBSee also:\fP
.RS 4
\fBautoHideEventFilter\fP 
.RE
.PP
Definition at line 222 of file kcursor.cpp.
.SS "void KCursor::setHideCursorDelay (int ms)\fC [static]\fP"
.PP
Sets the delay time in milliseconds for auto-hiding. When no keyboard events arrive for that time-frame, the cursor will be hidden.
.PP
Default is 5000, i.e. 5 seconds. Definition at line 233 of file kcursor.cpp.
.SS "int KCursor::hideCursorDelay ()\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
the current auto-hide delay time.
.RE
.PP
Default is 5000, i.e. 5 seconds. Definition at line 238 of file kcursor.cpp.
.SS "void KCursor::autoHideEventFilter (\fBQObject\fP *, \fBQEvent\fP *)\fC [static]\fP"
.PP
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.
.PP
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: 
.PP
.nf

 edit = new \fBKEdit\fP( this, 'some edit widget' );
 edit->installEventFilter( this );
 KCursor::setAutoHideCursor( edit, true, true );
.PP
.PP
.PP
.nf
 [...]
.PP
.PP
.PP
.nf
 bool YourClass::eventFilter( QObject *o, QEvent *e )
 {
     if ( o == edit ) // only that widget where you enabled auto-hide!
         KCursor::autoHideEventFilter( o, e );
.PP
.PP
.PP
.nf
     // now you can do your own event-processing
     [...]
 }
 
.PP
.PP
Note that you must not call \fBKCursor::autoHideEventFilter()\fP when you didn't enable or after disabling auto-hiding. Definition at line 228 of file kcursor.cpp.
.PP
Referenced by KLineEdit::eventFilter().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
