KCursor Class Reference
A wrapper around QCursor that allows for "themed" cursors. A QCursor wrapper allowing "themed" cursors and auto-hiding cursors. More...
#include <kcursor.h>
Inheritance diagram for KCursor:

Public Member Functions | |
KCursor () | |
Static Public Member Functions | |
QCursor | handCursor () |
QCursor | workingCursor () |
QCursor | arrowCursor () |
QCursor | upArrowCursor () |
QCursor | crossCursor () |
QCursor | waitCursor () |
QCursor | ibeamCursor () |
QCursor | sizeVerCursor () |
QCursor | sizeHorCursor () |
QCursor | sizeBDiagCursor () |
QCursor | sizeFDiagCursor () |
QCursor | sizeAllCursor () |
QCursor | blankCursor () |
QCursor | whatsThisCursor () |
void | setAutoHideCursor (QWidget *w, bool enable) |
void | setAutoHideCursor (QWidget *w, bool enable, bool customEventFilter) |
void | setHideCursorDelay (int ms) |
int | hideCursorDelay () |
void | autoHideEventFilter (QObject *, QEvent *) |
Detailed Description
A wrapper around QCursor that allows for "themed" cursors. A QCursor wrapper allowing "themed" cursors and auto-hiding cursors.Currently, the only themed cursor is a hand shaped cursor.
A typical usage would be
setCursor(KCursor::handCursor());
- Author:
- Kurt Granroth <granroth@kde.org>
Definition at line 43 of file kcursor.h.
Constructor & Destructor Documentation
|
Constructor. Does not do anything so far. Definition at line 39 of file kcursor.cpp. |
Member Function Documentation
|
Returns the proper hand cursor according to the current GUI style (static function). Definition at line 43 of file kcursor.cpp. References KGlobal::config(), and KConfigBase::readEntry(). |
|
Returns the proper arrow+hourglass cursor according to the current GUI style (static function). Definition at line 123 of file kcursor.cpp. |
|
Returns the proper arrow cursor according to the current GUI style (static function). This will change at some later date Definition at line 144 of file kcursor.cpp. |
|
Returns the proper up arrow cursor according to the current GUI style (static function). Definition at line 150 of file kcursor.cpp. |
|
Returns the proper cross-hair cursor according to the current GUI style (static function). Definition at line 156 of file kcursor.cpp. |
|
Returns the proper hourglass cursor according to the current GUI style (static function). Definition at line 162 of file kcursor.cpp. |
|
Returns the proper text cursor according to the current GUI style (static function). Definition at line 168 of file kcursor.cpp. |
|
Returns the proper vertical resize cursor according to the current GUI style (static function). Definition at line 174 of file kcursor.cpp. |
|
Returns the proper horizontal resize cursor according to the current GUI style (static function). Definition at line 180 of file kcursor.cpp. |
|
Returns the proper diagonal resize (/) cursor according to the current GUI style (static function). Definition at line 186 of file kcursor.cpp. |
|
Returns the proper diagonal resize (\) cursor according to the current GUI style (static function). Definition at line 192 of file kcursor.cpp. |
|
Returns the proper all-directions resize cursor according to the current GUI style (static function). Definition at line 198 of file kcursor.cpp. |
|
Returns a blank or invisible cursor (static function). Definition at line 204 of file kcursor.cpp. |
|
Returns a WhatsThis cursor (static function). Definition at line 209 of file kcursor.cpp. |
|
Sets auto-hiding the cursor for widget Enabling it will result in the cursor being hidden when
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(). Definition at line 216 of file kcursor.cpp. Referenced by KLineEdit::create(), KEdit::create(), KComboBox::create(), KEdit::KEdit(), and KTextEdit::KTextEdit(). |
|
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
|
|
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 232 of file kcursor.cpp. |
|
|
|
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 ); [...] 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 [...] } Note that you must not call KCursor::autoHideEventFilter() when you didn't enable or after disabling auto-hiding. Definition at line 227 of file kcursor.cpp. Referenced by KLineEdit::eventFilter(). |
The documentation for this class was generated from the following files: