Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix quitting-gesture crash

manongjohnf5d48a3ebce9
diff --git a/toonz/sources/toonzqt/schematicviewer.cpp b/toonz/sources/toonzqt/schematicviewer.cpp
index b683264ec..cc4f3798e 100644
--- a/toonz/sources/toonzqt/schematicviewer.cpp
+++ b/toonz/sources/toonzqt/schematicviewer.cpp
@@ -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);
}