if the user dragged less than KGlobalSettings::dndEventDelay() and releases, don't drag, but pass the click, start to drag after that threshold
svn path=/trunk/KDE/kdelibs/; revision=1084809
This commit is contained in:
parent
342be4bd86
commit
2e9b47d6bd
@ -597,15 +597,31 @@ bool ScrollWidget::eventFilter(QObject *watched, QEvent *event)
|
|||||||
if (event->type() == QEvent::GraphicsSceneMousePress ||
|
if (event->type() == QEvent::GraphicsSceneMousePress ||
|
||||||
event->type() == QEvent::GraphicsSceneMouseMove ||
|
event->type() == QEvent::GraphicsSceneMouseMove ||
|
||||||
event->type() == QEvent::GraphicsSceneMouseRelease) {
|
event->type() == QEvent::GraphicsSceneMouseRelease) {
|
||||||
if (scene()) {
|
|
||||||
|
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent *>(event);
|
||||||
|
|
||||||
|
if (event->type() == QEvent::GraphicsSceneMousePress) {
|
||||||
|
d->dragHandleClicked = me->scenePos();
|
||||||
|
}
|
||||||
|
|
||||||
|
d->dragging = (d->dragging | (d->dragHandleClicked.toPoint() - me->scenePos().toPoint()).manhattanLength() > (KGlobalSettings::dndEventDelay()));
|
||||||
|
|
||||||
|
if (scene() && event->type() != QEvent::GraphicsSceneMouseMove) {
|
||||||
scene()->sendEvent(this, event);
|
scene()->sendEvent(this, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent *>(event);
|
if (!d->dragging) {
|
||||||
if (event->type() == QEvent::GraphicsSceneMousePress) {
|
return false;
|
||||||
d->dragHandleClicked = me->scenePos();
|
}
|
||||||
} else if (event->type() == QEvent::GraphicsSceneMouseRelease &&
|
|
||||||
(d->dragHandleClicked.toPoint() - me->scenePos().toPoint()).manhattanLength() > KGlobalSettings::dndEventDelay()) {
|
if (scene() && event->type() == QEvent::GraphicsSceneMouseMove) {
|
||||||
|
scene()->sendEvent(this, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (event->type() == QEvent::GraphicsSceneMouseRelease) {
|
||||||
|
|
||||||
|
d->dragging = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user