aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-08-03 18:47:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-03 20:01:10 +0000
commitbc8f81ba345c455dd9f6a1fdbb9b2007bb21f6b8 (patch)
tree1e6608bbcf13c3223e3adf7192669e8fdd389103 /src
parent9cf6aea69becee1bc7cb0d41d6dca685f3c7b8c0 (diff)
Remove touchMouseIdCandidates
The set was there to protect from assigning to touchMouseId twice. That seems rather redundant: either something can become the touchMouseId, because touchMouseId is -1, or well, it can't. I suspect this set was needed before, when pre-grabbing was still there. Change-Id: I56d2c86cd13a3f6ec129d27ff8d5f7edf35df7cb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickwindow.cpp12
-rw-r--r--src/quick/items/qquickwindow_p.h2
2 files changed, 1 insertions, 13 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 9c42d77cde..022c930c28 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -666,8 +666,6 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QTouchEvent *eve
}
}
- // The event was accepted, we are done.
- touchMouseIdCandidates.clear();
return true;
}
// The event was not accepted but touchMouseId was set.
@@ -2177,7 +2175,6 @@ void QQuickWindowPrivate::deliverTouchEvent(QQuickPointerTouchEvent *event)
touchMouseId = -1;
touchMouseDevice = nullptr;
}
- touchMouseIdCandidates.remove(id);
} else {
allReleased = false;
}
@@ -2515,12 +2512,6 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
switch (tp.state()) {
case Qt::TouchPointPressed:
t = QEvent::MouseButtonPress;
- if (touchMouseId == -1) {
- // We don't want to later filter touches as a mouse event if they were pressed
- // while a touchMouseId was already active.
- // Remember this touch as a potential to become the touchMouseId.
- touchMouseIdCandidates.insert(tp.id());
- }
break;
case Qt::TouchPointReleased:
t = QEvent::MouseButtonRelease;
@@ -2533,7 +2524,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
}
// Only deliver mouse event if it is the touchMouseId or it could become the touchMouseId
- if ((touchMouseIdCandidates.contains(tp.id()) && touchMouseId == -1) || touchMouseId == tp.id()) {
+ if (touchMouseId == -1 || touchMouseId == tp.id()) {
// targetEvent is already transformed wrt local position, velocity, etc.
// FIXME: remove asTouchEvent!!!
@@ -2547,7 +2538,6 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
touchMouseDevice->pointerEvent()->pointById(tp.id())->setGrabber(target);
target->grabMouse();
}
- touchMouseIdCandidates.clear();
filtered = true;
}
// Only one event can be filtered as a mouse event.
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 9b380a66f8..fca0f78de5 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -265,8 +265,6 @@ public:
QOpenGLVertexArrayObjectHelper *vaoHelper;
- QSet<int> touchMouseIdCandidates;
-
mutable QQuickWindowIncubationController *incubationController;
static bool defaultAlphaBuffer;