Fix quitting-gesture crash

This commit is contained in:
manongjohn 2019-01-09 01:26:17 -05:00
parent 2d59e66990
commit f5d48a3ebc

View file

@ -664,19 +664,18 @@ bool SchematicSceneViewer::event(QEvent *e) {
}
*/
if (CommandManager::instance()
if (e->type() == QEvent::Gesture &&
CommandManager::instance()
->getAction(MI_TouchGestureControl)
->isChecked()) {
if (e->type() == QEvent::Gesture) {
gestureEvent(static_cast<QGestureEvent *>(e));
return true;
}
if (e->type() == QEvent::TouchBegin || e->type() == QEvent::TouchEnd ||
e->type() == QEvent::TouchCancel || e->type() == QEvent::TouchUpdate) {
touchEvent(static_cast<QTouchEvent *>(e), e->type());
m_gestureActive = true;
return true;
}
gestureEvent(static_cast<QGestureEvent *>(e));
return true;
}
if (e->type() == QEvent::TouchBegin || e->type() == QEvent::TouchEnd ||
e->type() == QEvent::TouchCancel || e->type() == QEvent::TouchUpdate) {
touchEvent(static_cast<QTouchEvent *>(e), e->type());
m_gestureActive = true;
return true;
}
return QGraphicsView::event(e);
}