diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-15 20:59:32 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-15 20:59:32 +0100 |
commit | fc9ee5223e2a533abc9e82dbf19253b788ac457b (patch) | |
tree | c2d4f5acba2e97189672b2fc6aea6253c678dc7e /src/templates/qquickabstractbutton.cpp | |
parent | f787a0353a347aa096d154b7d93c7890f0cd060a (diff) | |
parent | f56ec245eab24d56800a24f5bc06de1de4f87293 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
.qmake.conf
Change-Id: I4aae04ab8cac381b4a8262a2f47298ca014f4692
Diffstat (limited to 'src/templates/qquickabstractbutton.cpp')
-rw-r--r-- | src/templates/qquickabstractbutton.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/templates/qquickabstractbutton.cpp b/src/templates/qquickabstractbutton.cpp index 016c6d5a..8e5b59d2 100644 --- a/src/templates/qquickabstractbutton.cpp +++ b/src/templates/qquickabstractbutton.cpp @@ -121,6 +121,7 @@ void QQuickAbstractButtonPrivate::startPressAndHold() { Q_Q(QQuickAbstractButton); wasHeld = false; + stopPressAndHold(); if (isPressAndHoldConnected()) holdTimer = q->startTimer(QGuiApplication::styleHints()->mousePressAndHoldInterval()); } @@ -498,8 +499,10 @@ void QQuickAbstractButton::mousePressEvent(QMouseEvent *event) if (d->autoRepeat) { d->startRepeatDelay(); d->repeatButton = event->button(); - } else { + } else if (Qt::LeftButton == (event->buttons() & Qt::LeftButton)) { d->startPressAndHold(); + } else { + d->stopPressAndHold(); } } @@ -511,7 +514,7 @@ void QQuickAbstractButton::mouseMoveEvent(QMouseEvent *event) if (d->autoRepeat) d->stopPressRepeat(); - else if (!d->pressed) + else if (d->holdTimer > 0 && QLineF(d->pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance()) d->stopPressAndHold(); } |