From 6329570f8f8b8fe5dfd5967c157f8d34608b9fce Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 13 Jan 2008 05:33:05 +0000 Subject: [PATCH] icons moving doesn't trigger a click action svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760630 --- widgets/icon.cpp | 3 +++ widgets/icon_p.h | 1 + 2 files changed, 4 insertions(+) diff --git a/widgets/icon.cpp b/widgets/icon.cpp index 7c4cb7f49..24eaf3946 100644 --- a/widgets/icon.cpp +++ b/widgets/icon.cpp @@ -963,6 +963,7 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event) } d->states |= Private::PressedState; + d->clickStartPos = scenePos(); bool handled = false; foreach (IconAction *action, d->cornerActions) { @@ -1016,6 +1017,8 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } } + handled = d->clickStartPos != scenePos(); + if (!handled) { if (boundingRect().contains(event->pos())) { emit clicked(); diff --git a/widgets/icon_p.h b/widgets/icon_p.h index db9354558..c24a6a8b4 100644 --- a/widgets/icon_p.h +++ b/widgets/icon_p.h @@ -174,6 +174,7 @@ public: bool invertLayout; bool drawBg; QSizeF currentSize; + QPointF clickStartPos; QList cornerActions;