\section{KCursor Class Reference}
\label{classKCursor}\index{KCursor@{KCursor}}
A {\bf QCursor} wrapper allowing \char`\"{}themed\char`\"{} cursors and auto-hiding cursors.  


{\tt \#include $<$kcursor.h$>$}

Inheritance diagram for KCursor:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=44pt]{classKCursor__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KCursor:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=86pt]{classKCursor__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KCursor} ()
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QCursor} {\bf hand\-Cursor} ()
\item 
static {\bf QCursor} {\bf working\-Cursor} ()
\item 
static {\bf QCursor} {\bf arrow\-Cursor} ()
\item 
static {\bf QCursor} {\bf up\-Arrow\-Cursor} ()
\item 
static {\bf QCursor} {\bf cross\-Cursor} ()
\item 
static {\bf QCursor} {\bf wait\-Cursor} ()
\item 
static {\bf QCursor} {\bf ibeam\-Cursor} ()
\item 
static {\bf QCursor} {\bf size\-Ver\-Cursor} ()
\item 
static {\bf QCursor} {\bf size\-Hor\-Cursor} ()
\item 
static {\bf QCursor} {\bf size\-BDiag\-Cursor} ()
\item 
static {\bf QCursor} {\bf size\-FDiag\-Cursor} ()
\item 
static {\bf QCursor} {\bf size\-All\-Cursor} ()
\item 
static {\bf QCursor} {\bf blank\-Cursor} ()
\item 
static {\bf QCursor} {\bf whats\-This\-Cursor} ()
\item 
static void {\bf set\-Auto\-Hide\-Cursor} ({\bf QWidget} $\ast$w, bool enable)
\item 
static void {\bf set\-Auto\-Hide\-Cursor} ({\bf QWidget} $\ast$w, bool enable, bool custom\-Event\-Filter)
\item 
static void {\bf set\-Hide\-Cursor\-Delay} (int ms)
\item 
static int {\bf hide\-Cursor\-Delay} ()
\item 
static void {\bf auto\-Hide\-Event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)
\end{CompactItemize}


\subsection{Detailed Description}
A {\bf QCursor} wrapper allowing \char`\"{}themed\char`\"{} cursors and auto-hiding cursors. 

A wrapper around {\bf QCursor} that allows for \char`\"{}themed\char`\"{} cursors.

Currently, the only themed cursor is a hand shaped cursor.

A typical usage would be 

\footnotesize\begin{verbatim} setCursor(KCursor::handCursor());
\end{verbatim}
\normalsize


\begin{Desc}
\item[Author:]Kurt Granroth $<${\tt granroth@kde.org}$>$ \end{Desc}




Definition at line 45 of file kcursor.h.

\subsection{Constructor \& Destructor Documentation}
\index{KCursor@{KCursor}!KCursor@{KCursor}}
\index{KCursor@{KCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KCursor::KCursor ()}\label{classKCursor_a0}


Constructor. 

Does not do anything so far. 

Definition at line 39 of file kcursor.cpp.

\subsection{Member Function Documentation}
\index{KCursor@{KCursor}!handCursor@{handCursor}}
\index{handCursor@{handCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::hand\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e0}


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

Q\_\-WS\_\-WIN 

Definition at line 43 of file kcursor.cpp.

References KGlobal::config(), QCursor::handle(), and KConfig\-Base::read\-Entry().\index{KCursor@{KCursor}!workingCursor@{workingCursor}}
\index{workingCursor@{workingCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::working\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e1}


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



Definition at line 125 of file kcursor.cpp.

References QCursor::handle().\index{KCursor@{KCursor}!arrowCursor@{arrowCursor}}
\index{arrowCursor@{arrowCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::arrow\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e2}


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

This will change at some later date 

Definition at line 146 of file kcursor.cpp.\index{KCursor@{KCursor}!upArrowCursor@{upArrowCursor}}
\index{upArrowCursor@{upArrowCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::up\-Arrow\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e3}


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



Definition at line 152 of file kcursor.cpp.\index{KCursor@{KCursor}!crossCursor@{crossCursor}}
\index{crossCursor@{crossCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::cross\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e4}


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



Definition at line 158 of file kcursor.cpp.\index{KCursor@{KCursor}!waitCursor@{waitCursor}}
\index{waitCursor@{waitCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::wait\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e5}


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



Definition at line 164 of file kcursor.cpp.\index{KCursor@{KCursor}!ibeamCursor@{ibeamCursor}}
\index{ibeamCursor@{ibeamCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::ibeam\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e6}


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



Definition at line 170 of file kcursor.cpp.\index{KCursor@{KCursor}!sizeVerCursor@{sizeVerCursor}}
\index{sizeVerCursor@{sizeVerCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::size\-Ver\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e7}


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



Definition at line 176 of file kcursor.cpp.\index{KCursor@{KCursor}!sizeHorCursor@{sizeHorCursor}}
\index{sizeHorCursor@{sizeHorCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::size\-Hor\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e8}


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



Definition at line 182 of file kcursor.cpp.\index{KCursor@{KCursor}!sizeBDiagCursor@{sizeBDiagCursor}}
\index{sizeBDiagCursor@{sizeBDiagCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::size\-BDiag\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e9}


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



Definition at line 188 of file kcursor.cpp.\index{KCursor@{KCursor}!sizeFDiagCursor@{sizeFDiagCursor}}
\index{sizeFDiagCursor@{sizeFDiagCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::size\-FDiag\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e10}


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



Definition at line 194 of file kcursor.cpp.\index{KCursor@{KCursor}!sizeAllCursor@{sizeAllCursor}}
\index{sizeAllCursor@{sizeAllCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::size\-All\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e11}


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



Definition at line 200 of file kcursor.cpp.\index{KCursor@{KCursor}!blankCursor@{blankCursor}}
\index{blankCursor@{blankCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::blank\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e12}


Returns a blank or invisible cursor (static function). 



Definition at line 206 of file kcursor.cpp.\index{KCursor@{KCursor}!whatsThisCursor@{whatsThisCursor}}
\index{whatsThisCursor@{whatsThisCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCursor} KCursor::whats\-This\-Cursor ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e13}


Returns a Whats\-This cursor (static function). 



Definition at line 211 of file kcursor.cpp.\index{KCursor@{KCursor}!setAutoHideCursor@{setAutoHideCursor}}
\index{setAutoHideCursor@{setAutoHideCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCursor::set\-Auto\-Hide\-Cursor ({\bf QWidget} $\ast$ {\em w}, bool {\em enable})\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e14}


Sets auto-hiding the cursor for widget {\tt w}. 

Enabling it will result in the cursor being hidden when \begin{itemize}
\item a key-event happens \item there are no key-events for a configured time-frame (see {\bf set\-Hide\-Cursor\-Delay()}{\rm (p.\,\pageref{classKCursor_e16})})\end{itemize}
The cursor will be shown again when the focus is lost or a mouse-event happens.

Side effect: when enabling auto-hide, mouse\-Tracking is enabled for the specified widget, because it's needed to get mouse-move-events. So don't disable mouse\-Tracking for a widget while using auto-hide for it.

When disabling auto-hide, mouse\-Tracking will be disabled, so if you need mouse\-Tracking after disabling auto-hide, you have to reenable mouse\-Tracking.

If you want to use auto-hiding for widgets that don't take focus, e.g. a {\bf QCanvas\-View}, then you have to pass all key-events that should trigger auto-hiding to {\bf auto\-Hide\-Event\-Filter()}{\rm (p.\,\pageref{classKCursor_e18})}. 

Definition at line 218 of file kcursor.cpp.

Referenced by KLine\-Edit::create(), KEdit::create(), KCombo\-Box::create(), KEdit::KEdit(), and KText\-Edit::KText\-Edit().\index{KCursor@{KCursor}!setAutoHideCursor@{setAutoHideCursor}}
\index{setAutoHideCursor@{setAutoHideCursor}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCursor::set\-Auto\-Hide\-Cursor ({\bf QWidget} $\ast$ {\em w}, bool {\em enable}, bool {\em custom\-Event\-Filter})\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e15}


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 {\tt custom\-Event\-Filter} to true and call {\bf auto\-Hide\-Event\-Filter()}{\rm (p.\,\pageref{classKCursor_e18})} from the beginning of your event\-Filter().

\begin{Desc}
\item[See also:]{\bf auto\-Hide\-Event\-Filter}{\rm (p.\,\pageref{classKCursor_e18})} \end{Desc}


Definition at line 223 of file kcursor.cpp.\index{KCursor@{KCursor}!setHideCursorDelay@{setHideCursorDelay}}
\index{setHideCursorDelay@{setHideCursorDelay}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCursor::set\-Hide\-Cursor\-Delay (int {\em ms})\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e16}


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. 

Definition at line 234 of file kcursor.cpp.\index{KCursor@{KCursor}!hideCursorDelay@{hideCursorDelay}}
\index{hideCursorDelay@{hideCursorDelay}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KCursor::hide\-Cursor\-Delay ()\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e17}


\begin{Desc}
\item[Returns:]the current auto-hide delay time.\end{Desc}
Default is 5000, i.e. 5 seconds. 

Definition at line 239 of file kcursor.cpp.\index{KCursor@{KCursor}!autoHideEventFilter@{autoHideEventFilter}}
\index{autoHideEventFilter@{autoHideEventFilter}!KCursor@{KCursor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCursor::auto\-Hide\-Event\-Filter ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [static]}}\label{classKCursor_e18}


KCursor has to install an event\-Filter over the widget you want to auto-hide. 

If you have an own event\-Filter() 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 set\-Auto\-Hide\-Cursor( widget, true, true ); to tell KCursor not to install an event\-Filter. Then you call this method from the beginning of your event\-Filter, for example: 

\footnotesize\begin{verbatim} 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
     [...]
 }
\end{verbatim}
\normalsize


Note that you must not call {\bf KCursor::auto\-Hide\-Event\-Filter()}{\rm (p.\,\pageref{classKCursor_e18})} when you didn't enable or after disabling auto-hiding. 

Definition at line 229 of file kcursor.cpp.

Referenced by KLine\-Edit::event\-Filter().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kcursor.h\item 
kcursor.cpp\end{CompactItemize}
