@@ -176,6 +176,7 @@ bool OcctQWidgetViewer::event(QEvent* theEvent)
176176 if (!isTouch)
177177 return QWidget::event (theEvent);
178178
179+ theEvent->accept ();
179180 bool hasUpdates = false ;
180181 const QTouchEvent* aQTouchEvent = static_cast <QTouchEvent*>(theEvent);
181182 for (const QTouchEvent::TouchPoint& aQTouch : aQTouchEvent->touchPoints ())
@@ -237,6 +238,7 @@ void OcctQWidgetViewer::keyPressEvent(QKeyEvent* theEvent)
237238 {
238239 myView->FitAll (0.01 , false );
239240 update ();
241+ theEvent->accept ();
240242 return ;
241243 }
242244 }
@@ -255,6 +257,7 @@ void OcctQWidgetViewer::mousePressEvent(QMouseEvent* theEvent)
255257 if (myHasTouchInput && theEvent->source () == Qt::MouseEventSynthesizedBySystem)
256258 return ; // skip mouse events emulated by system from screen touches
257259
260+ theEvent->accept ();
258261 const Graphic3d_Vec2i aPnt (theEvent->pos ().x (), theEvent->pos ().y ());
259262 const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
260263 const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
@@ -271,6 +274,7 @@ void OcctQWidgetViewer::mouseReleaseEvent(QMouseEvent* theEvent)
271274 if (myView.IsNull ())
272275 return ;
273276
277+ theEvent->accept ();
274278 const Graphic3d_Vec2i aPnt (theEvent->pos ().x (), theEvent->pos ().y ());
275279 const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
276280 const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
@@ -290,6 +294,7 @@ void OcctQWidgetViewer::mouseMoveEvent(QMouseEvent* theEvent)
290294 if (myHasTouchInput && theEvent->source () == Qt::MouseEventSynthesizedBySystem)
291295 return ; // skip mouse events emulated by system from screen touches
292296
297+ theEvent->accept ();
293298 const Graphic3d_Vec2i aNewPos (theEvent->pos ().x (), theEvent->pos ().y ());
294299 const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
295300 const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
@@ -306,6 +311,7 @@ void OcctQWidgetViewer::wheelEvent(QWheelEvent* theEvent)
306311 if (myView.IsNull ())
307312 return ;
308313
314+ theEvent->accept ();
309315#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
310316 const Graphic3d_Vec2i aPos (Graphic3d_Vec2d (theEvent->position ().x (), theEvent->position ().y ()));
311317#else
0 commit comments