Fix quitting-gesture crash
This commit is contained in:
parent
2d59e66990
commit
f5d48a3ebc
1 changed files with 10 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue