summaryrefslogtreecommitdiffstats
path: root/src/server/connectionframe/connectionframe.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-04-25 17:24:32 +0200
committerManuel Schneider2014-04-25 17:24:32 +0200
commit346aaf9a63bca22a42d112397c1a0de49e80384d (patch)
treef7959b45fc556454b8babb72d6596adf6a7dd913 /src/server/connectionframe/connectionframe.cpp
parentThrown out redundant slots. (diff)
downloadpvs2-346aaf9a63bca22a42d112397c1a0de49e80384d.tar.gz
pvs2-346aaf9a63bca22a42d112397c1a0de49e80384d.tar.xz
pvs2-346aaf9a63bca22a42d112397c1a0de49e80384d.zip
recognize a dragmove only if the distance is larger than 40 px
Diffstat (limited to 'src/server/connectionframe/connectionframe.cpp')
-rw-r--r--src/server/connectionframe/connectionframe.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index f5739ee..7d9376c 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -131,16 +131,19 @@ void ConnectionFrame::mouseReleaseEvent(QMouseEvent* event)
event->accept();
if (event->button() == Qt::LeftButton)
{
- QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor));
- if (this->pos() != _previousPosition) {
- qDebug("Moved");
- emit frameMoved(this);
- }
- else
- {
- qDebug("Clicked");
- emit clicked(this);
- }
+ QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor));
+ // Only recognize a move if the distance is larger than _startDragDistance
+ if ((this->pos() - _previousPosition).manhattanLength() > _startDragDistance )
+ {
+ qDebug("Moved");
+ emit frameMoved(this);
+ }
+ else
+ {
+ qDebug("Clicked");
+ move(_previousPosition);
+ emit clicked(this);
+ }
}
}