.TH "KCursor" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCursor \- 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
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQCursor\fP \fBhandCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBworkingCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBarrowCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBupArrowCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBcrossCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBwaitCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBibeamCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBsizeVerCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBsizeHorCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBsizeBDiagCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBsizeFDiagCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBsizeAllCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBblankCursor\fP ()"
.br
.ti -1c
.RI "static \fBQCursor\fP \fBwhatsThisCursor\fP ()"
.br
.ti -1c
.RI "static void \fBsetAutoHideCursor\fP (\fBQWidget\fP *w, bool enable)"
.br
.ti -1c
.RI "static void \fBsetAutoHideCursor\fP (\fBQWidget\fP *w, bool enable, bool customEventFilter)"
.br
.ti -1c
.RI "static void \fBsetHideCursorDelay\fP (int ms)"
.br
.ti -1c
.RI "static int \fBhideCursorDelay\fP ()"
.br
.ti -1c
.RI "static void \fBautoHideEventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A \fBQCursor\fP wrapper allowing 'themed' cursors and auto-hiding cursors. 

A wrapper around \fBQCursor\fP that allows for 'themed' cursors.
.PP
Currently, the only themed cursor is a hand shaped cursor.
.PP
A typical usage would be 
.PP
.nf
 setCursor(KCursor::handCursor());

.fi
.PP
.PP
\fBAuthor:\fP
.RS 4
Kurt Granroth <granroth@kde.org> 
.RE
.PP

.PP
Definition at line 45 of file kcursor.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCursor::KCursor ()"
.PP
Constructor. 
.PP
Does not do anything so far. 
.PP
Definition at line 39 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). 
.PP
Q_WS_WIN 
.PP
Definition at line 43 of file kcursor.cpp.
.PP
References KGlobal::config(), QCursor::handle(), and KConfigBase::readEntry().
.SS "\fBQCursor\fP KCursor::workingCursor ()\fC [static]\fP"
.PP
Returns the proper arrow+hourglass cursor according to the current GUI style (static function). 
.PP
Definition at line 125 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). 
.PP
This will change at some later date 
.PP
Definition at line 146 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). 
.PP
Definition at line 152 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). 
.PP
Definition at line 158 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). 
.PP
Definition at line 164 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). 
.PP
Definition at line 170 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). 
.PP
Definition at line 176 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). 
.PP
Definition at line 182 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). 
.PP
Definition at line 188 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). 
.PP
Definition at line 194 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). 
.PP
Definition at line 200 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::blankCursor ()\fC [static]\fP"
.PP
Returns a blank or invisible cursor (static function). 
.PP
Definition at line 206 of file kcursor.cpp.
.SS "\fBQCursor\fP KCursor::whatsThisCursor ()\fC [static]\fP"
.PP
Returns a WhatsThis cursor (static function). 
.PP
Definition at line 211 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. 
.PP
Enabling it will result in the cursor being hidden when 
.PD 0

.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. 
.PP
Definition at line 218 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. 
.PP
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

.PP
Definition at line 223 of file kcursor.cpp.
.SS "void KCursor::setHideCursorDelay (int ms)\fC [static]\fP"
.PP
Sets the delay time in milliseconds for auto-hiding. 
.PP
When no keyboard events arrive for that time-frame, the cursor will be hidden.
.PP
Default is 5000, i.e. 5 seconds. 
.PP
Definition at line 234 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. 
.PP
Definition at line 239 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. 
.PP
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 KEdit( this, 'some edit widget' );
 edit->installEventFilter( this );
 KCursor::setAutoHideCursor( edit, true, true );

 [...]

 bool 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
     [...]
 }

.fi
.PP
.PP
Note that you must not call \fBKCursor::autoHideEventFilter()\fP when you didn't enable or after disabling auto-hiding. 
.PP
Definition at line 229 of file kcursor.cpp.
.PP
Referenced by KLineEdit::eventFilter().

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