|
|
Access the KDE global objects.
KInstance * instance () |
Retrieve the global instance. There is always at least one instance of a component in one application (in most cases the application itself).
KStandardDirs * dirs () |
Retrieve the application standard dirs object.
KConfig * config () |
Retrieve the general config object.
KIconLoader * iconLoader () |
Retrieve an iconloader object.
int dndEventDelay () |
Returns a treshold in pixels for drag & drop operations. As long as the mouse movement has not exceeded this number of pixels in either X or Y direction no drag operation may be started. This prevents spurious drags when the user intended to click on something but moved the mouse a bit while doing so.
For this to work you must save the position of the mouse (oldPos
)
in the QWidget::mousePressEvent().
When the position of the mouse (newPos
)
in a QWidget::mouseMoveEvent() exceeds this treshold
you may start a drag
which should originate from oldPos.
Example code:
void KColorCells::mousePressEvent( QMouseEvent *e ) { mOldPos = e->pos(); } void KColorCells::mouseMoveEvent( QMouseEvent *e ) { if( !(e->state() && LeftButton)) return; int delay = KGlobal::dndEventDelay(); QPoint newPos = e->pos(); if(newPos->x() > mOldPos.x()+delay || newPos->x() < mOldPos.x()-delay || newPos->y() > mOldPos.y()+delay || newPos->y() < mOldPos.y()-delay) { // Drag color object int cell = posToCell(mOldPos); // Find color at mOldPos if ((cell != -1) && colors[cell].isValid()) { KColorDrag *d = KColorDrag::makeDrag( colors[cell], this); d->dragCopy(); } } }
bool useDoubleClicks () |
Returns whether KDE runs in single (default) or double click mode.
see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
Returns: @ false if single click mode, or true
if double click mode.
enum Completion {CompletionNone=1, CompletionAuto, CompletionMan, CompletionShell } |
Retrieve the configured completion mode.
see http://developer.kde.org/documentation/standards/kde/style/keys/completion.html
Returns: CompletionNone: Completion should be disabled CompletionAuto: Automatic completion CompletionMan: Like automatic completion except the user initiates the completion using the completion key as in CompletionEOL CompletionShell: Attempts to mimic the completion feature found in typical *nix shell enviornments.