@@ -176,16 +176,16 @@ bool OcctQWidgetViewer::event(QEvent* theEvent)
176176 && aNewPos2i.minComp () >= 0 )
177177 {
178178 hasUpdates = true ;
179- AddTouchPoint (aTouchId, aNewPos2d);
179+ AIS_ViewController:: AddTouchPoint (aTouchId, aNewPos2d);
180180 }
181181 else if (aQTouch.state () == Qt::TouchPointMoved
182- && TouchPoints ().Contains (aTouchId))
182+ && AIS_ViewController:: TouchPoints ().Contains (aTouchId))
183183 {
184184 hasUpdates = true ;
185- UpdateTouchPoint (aTouchId, aNewPos2d);
185+ AIS_ViewController:: UpdateTouchPoint (aTouchId, aNewPos2d);
186186 }
187187 else if (aQTouch.state () == Qt::TouchPointReleased
188- && RemoveTouchPoint (aTouchId))
188+ && AIS_ViewController:: RemoveTouchPoint (aTouchId))
189189 {
190190 hasUpdates = true ;
191191 }
@@ -217,11 +217,13 @@ void OcctQWidgetViewer::keyPressEvent(QKeyEvent* theEvent)
217217 const Aspect_VKey aKey = OcctQtTools::qtKey2VKey (theEvent->key ());
218218 switch (aKey)
219219 {
220- case Aspect_VKey_Escape: {
220+ case Aspect_VKey_Escape:
221+ {
221222 QApplication::exit ();
222223 return ;
223224 }
224- case Aspect_VKey_F: {
225+ case Aspect_VKey_F:
226+ {
225227 myView->FitAll (0.01 , false );
226228 update ();
227229 return ;
@@ -243,8 +245,9 @@ void OcctQWidgetViewer::mousePressEvent(QMouseEvent* theEvent)
243245 return ; // skip mouse events emulated by system from screen touches
244246
245247 const Graphic3d_Vec2i aPnt (theEvent->pos ().x (), theEvent->pos ().y ());
248+ const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
246249 const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
247- if (UpdateMouseButtons (aPnt, OcctQtTools::qtMouseButtons2VKeys (theEvent-> buttons ()) , aFlags, false ))
250+ if (AIS_ViewController:: UpdateMouseButtons (aPnt, aButtons , aFlags, false ))
248251 updateView ();
249252}
250253
@@ -258,8 +261,9 @@ void OcctQWidgetViewer::mouseReleaseEvent(QMouseEvent* theEvent)
258261 return ;
259262
260263 const Graphic3d_Vec2i aPnt (theEvent->pos ().x (), theEvent->pos ().y ());
264+ const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
261265 const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
262- if (UpdateMouseButtons (aPnt, OcctQtTools::qtMouseButtons2VKeys (theEvent-> buttons ()) , aFlags, false ))
266+ if (AIS_ViewController:: UpdateMouseButtons (aPnt, aButtons , aFlags, false ))
263267 updateView ();
264268}
265269
@@ -275,14 +279,11 @@ void OcctQWidgetViewer::mouseMoveEvent(QMouseEvent* theEvent)
275279 if (myHasTouchInput && theEvent->source () == Qt::MouseEventSynthesizedBySystem)
276280 return ; // skip mouse events emulated by system from screen touches
277281
278- const Graphic3d_Vec2i aNewPos (theEvent->pos ().x (), theEvent->pos ().y ());
279- if (UpdateMousePosition (aNewPos,
280- OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ()),
281- OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ()),
282- false ))
283- {
282+ const Graphic3d_Vec2i aNewPos (theEvent->pos ().x (), theEvent->pos ().y ());
283+ const Aspect_VKeyMouse aButtons = OcctQtTools::qtMouseButtons2VKeys (theEvent->buttons ());
284+ const Aspect_VKeyFlags aFlags = OcctQtTools::qtMouseModifiers2VKeys (theEvent->modifiers ());
285+ if (AIS_ViewController::UpdateMousePosition (aNewPos, aButtons, aFlags, false ))
284286 updateView ();
285- }
286287}
287288
288289// ==============================================================================
@@ -314,7 +315,7 @@ void OcctQWidgetViewer::wheelEvent(QWheelEvent* theEvent)
314315 }
315316#endif
316317
317- if (UpdateZoom (Aspect_ScrollDelta (aPos, double (theEvent->angleDelta ().y ()) / 8.0 )))
318+ if (AIS_ViewController:: UpdateZoom (Aspect_ScrollDelta (aPos, double (theEvent->angleDelta ().y ()) / 8.0 )))
318319 updateView ();
319320}
320321
@@ -323,7 +324,7 @@ void OcctQWidgetViewer::wheelEvent(QWheelEvent* theEvent)
323324// =======================================================================
324325void OcctQWidgetViewer::updateView ()
325326{
326- update ();
327+ QWidget:: update ();
327328 // if (window() != NULL) { window()->update(); }
328329}
329330
@@ -369,7 +370,7 @@ void OcctQWidgetViewer::paintEvent(QPaintEvent* )
369370 // flush pending input events and redraw the viewer
370371 Handle (V3d_View) aView = !myFocusView.IsNull () ? myFocusView : myView;
371372 aView->InvalidateImmediate ();
372- FlushViewEvents (myContext, aView, true );
373+ AIS_ViewController:: FlushViewEvents (myContext, aView, true );
373374}
374375
375376// ================================================================
0 commit comments