aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp7
-rw-r--r--src/quicktemplates2/qquickabstractbutton_p_p.h1
-rw-r--r--src/quicktemplates2/qquicktooltip.cpp15
3 files changed, 19 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index 8ce4d0e5..8632e14c 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -178,7 +178,7 @@ void QQuickAbstractButtonPrivate::handleRelease(const QPointF &point)
if (wasPressed) {
emit q->released();
- if (!wasHeld)
+ if (!wasHeld && !wasDoubleClick)
trigger();
} else {
emit q->canceled();
@@ -188,6 +188,8 @@ void QQuickAbstractButtonPrivate::handleRelease(const QPointF &point)
stopPressRepeat();
else
stopPressAndHold();
+
+ wasDoubleClick = false;
}
void QQuickAbstractButtonPrivate::handleUngrab()
@@ -201,6 +203,7 @@ void QQuickAbstractButtonPrivate::handleUngrab()
q->setPressed(false);
stopPressRepeat();
stopPressAndHold();
+ wasDoubleClick = false;
emit q->canceled();
}
@@ -1080,8 +1083,10 @@ void QQuickAbstractButton::mousePressEvent(QMouseEvent *event)
void QQuickAbstractButton::mouseDoubleClickEvent(QMouseEvent *event)
{
+ Q_D(QQuickAbstractButton);
QQuickControl::mouseDoubleClickEvent(event);
emit doubleClicked();
+ d->wasDoubleClick = true;
}
void QQuickAbstractButton::timerEvent(QTimerEvent *event)
diff --git a/src/quicktemplates2/qquickabstractbutton_p_p.h b/src/quicktemplates2/qquickabstractbutton_p_p.h
index 8ad479e2..9291c1a8 100644
--- a/src/quicktemplates2/qquickabstractbutton_p_p.h
+++ b/src/quicktemplates2/qquickabstractbutton_p_p.h
@@ -124,6 +124,7 @@ public:
bool autoExclusive = false;
bool autoRepeat = false;
bool wasHeld = false;
+ bool wasDoubleClick = false;
int holdTimer = 0;
int delayTimer = 0;
int repeatTimer = 0;
diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp
index 9d733c94..8b61375e 100644
--- a/src/quicktemplates2/qquicktooltip.cpp
+++ b/src/quicktemplates2/qquicktooltip.cpp
@@ -252,9 +252,18 @@ void QQuickToolTip::setVisible(bool visible)
{
Q_D(QQuickToolTip);
if (visible) {
- if (!d->visible && d->delay > 0) {
- d->startDelay();
- return;
+ if (!d->visible) {
+ // We are being made visible, and we weren't before.
+ if (d->delay > 0) {
+ d->startDelay();
+ return;
+ }
+ } else {
+ // We are being made visible, even though we already were.
+ // We've probably been re-opened before our exit transition could finish.
+ // In that case, we need to manually start the timeout, as that is usually
+ // done in itemChange(), which won't be called in this situation.
+ d->startTimeout();
}
} else {
d->stopDelay();