• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Member Functions | Static Public Member Functions | List of all members
KCursor Class Reference

#include <kcursor.h>

Inherits TQt.

Public Member Functions

 KCursor ()
 

Static Public Member Functions

static TQCursor handCursor ()
 
static TQCursor workingCursor ()
 
static TQCursor arrowCursor ()
 
static TQCursor upArrowCursor ()
 
static TQCursor crossCursor ()
 
static TQCursor waitCursor ()
 
static TQCursor ibeamCursor ()
 
static TQCursor sizeVerCursor ()
 
static TQCursor sizeHorCursor ()
 
static TQCursor sizeBDiagCursor ()
 
static TQCursor sizeFDiagCursor ()
 
static TQCursor sizeAllCursor ()
 
static TQCursor blankCursor ()
 
static TQCursor whatsThisCursor ()
 
static void setAutoHideCursor (TQWidget *w, bool enable)
 
static void setAutoHideCursor (TQWidget *w, bool enable, bool customEventFilter)
 
static void setHideCursorDelay (int ms)
 
static int hideCursorDelay ()
 
static void autoHideEventFilter (TQObject *, TQEvent *)
 

Detailed Description

A TQCursor wrapper allowing "themed" cursors and auto-hiding cursors.

A wrapper around TQCursor that allows for "themed" cursors.

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

A typical usage would be

setCursor(KCursor::handCursor());
KCursor::handCursor
static TQCursor handCursor()
Returns the proper hand cursor according to the current GUI style (static function).
Definition: kcursor.cpp:43
Author
Kurt Granroth granr.nosp@m.oth@.nosp@m.kde.o.nosp@m.rg

Definition at line 45 of file kcursor.h.

Constructor & Destructor Documentation

◆ KCursor()

KCursor::KCursor ( )

Constructor.

Does not do anything so far.

Definition at line 39 of file kcursor.cpp.

Member Function Documentation

◆ arrowCursor()

TQCursor KCursor::arrowCursor ( )
static

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

All of the follow functions will return the Qt default for now regardless of the style.

This will change at some later date

Definition at line 146 of file kcursor.cpp.

◆ autoHideEventFilter()

void KCursor::autoHideEventFilter ( TQObject *  o,
TQEvent *  e 
)
static

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( TQObject *o, TQEvent *e )
{
if ( o == edit ) // only that widget where you enabled auto-hide!
KCursor::autoHideEventFilter( o, e );
// now you can do your own event-processing
[...]
}
KCursor::setAutoHideCursor
static void setAutoHideCursor(TQWidget *w, bool enable)
Sets auto-hiding the cursor for widget w.
Definition: kcursor.cpp:218
KCursor::autoHideEventFilter
static void autoHideEventFilter(TQObject *, TQEvent *)
KCursor has to install an eventFilter over the widget you want to auto-hide.
Definition: kcursor.cpp:229
KEdit
A simple text editor for the KDE project.
Definition: keditcl.h:172

Note that you must not call KCursor::autoHideEventFilter() when you didn't enable or after disabling auto-hiding.

Definition at line 229 of file kcursor.cpp.

◆ blankCursor()

TQCursor KCursor::blankCursor ( )
static

Returns a blank or invisible cursor (static function).

Definition at line 206 of file kcursor.cpp.

◆ crossCursor()

TQCursor KCursor::crossCursor ( )
static

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

Definition at line 158 of file kcursor.cpp.

◆ handCursor()

TQCursor KCursor::handCursor ( )
static

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

TQ_WS_WIN

Definition at line 43 of file kcursor.cpp.

◆ hideCursorDelay()

int KCursor::hideCursorDelay ( )
static
Returns
the current auto-hide delay time.

Default is 5000, i.e. 5 seconds.

Definition at line 239 of file kcursor.cpp.

◆ ibeamCursor()

TQCursor KCursor::ibeamCursor ( )
static

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

Definition at line 170 of file kcursor.cpp.

◆ setAutoHideCursor() [1/2]

void KCursor::setAutoHideCursor ( TQWidget *  w,
bool  enable 
)
static

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 TQCanvasView, then you have to pass all key-events that should trigger auto-hiding to autoHideEventFilter().

Definition at line 218 of file kcursor.cpp.

◆ setAutoHideCursor() [2/2]

void KCursor::setAutoHideCursor ( TQWidget *  w,
bool  enable,
bool  customEventFilter 
)
static

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
autoHideEventFilter

Definition at line 223 of file kcursor.cpp.

◆ setHideCursorDelay()

void KCursor::setHideCursorDelay ( int  ms)
static

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.

◆ sizeAllCursor()

TQCursor KCursor::sizeAllCursor ( )
static

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

Definition at line 200 of file kcursor.cpp.

◆ sizeBDiagCursor()

TQCursor KCursor::sizeBDiagCursor ( )
static

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

Definition at line 188 of file kcursor.cpp.

◆ sizeFDiagCursor()

TQCursor KCursor::sizeFDiagCursor ( )
static

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

Definition at line 194 of file kcursor.cpp.

◆ sizeHorCursor()

TQCursor KCursor::sizeHorCursor ( )
static

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

Definition at line 182 of file kcursor.cpp.

◆ sizeVerCursor()

TQCursor KCursor::sizeVerCursor ( )
static

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

Definition at line 176 of file kcursor.cpp.

◆ upArrowCursor()

TQCursor KCursor::upArrowCursor ( )
static

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

Definition at line 152 of file kcursor.cpp.

◆ waitCursor()

TQCursor KCursor::waitCursor ( )
static

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

Definition at line 164 of file kcursor.cpp.

◆ whatsThisCursor()

TQCursor KCursor::whatsThisCursor ( )
static

Returns a WhatsThis cursor (static function).

Definition at line 211 of file kcursor.cpp.

◆ workingCursor()

TQCursor KCursor::workingCursor ( )
static

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

Definition at line 125 of file kcursor.cpp.


The documentation for this class was generated from the following files:
  • kcursor.h
  • kcursor.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.