MCPcopy Create free account
hub / github.com/comaps/comaps / keyPressEvent

Method keyPressEvent

qt/draw_widget.cpp:431–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void DrawWidget::keyPressEvent(QKeyEvent * e)
432{
433 if (m_screenshotMode)
434 return;
435
436 if (IsLeftButton(QGuiApplication::mouseButtons()) && e->key() == Qt::Key_Control)
437 {
438 df::TouchEvent event;
439 event.SetTouchType(df::TouchEvent::TOUCH_DOWN);
440 df::Touch touch;
441 touch.m_id = 0;
442 touch.m_location = m2::PointD(L2D(QCursor::pos().x()), L2D(QCursor::pos().y()));
443 event.SetFirstTouch(touch);
444 event.SetSecondTouch(GetSymmetrical(touch));
445
446 m_framework.TouchEvent(event);
447 }
448}
449
450void DrawWidget::keyReleaseEvent(QKeyEvent * e)
451{

Callers

nothing calls this directly

Calls 7

IsLeftButtonFunction · 0.85
SetTouchTypeMethod · 0.80
SetFirstTouchMethod · 0.80
SetSecondTouchMethod · 0.80
xMethod · 0.45
yMethod · 0.45
TouchEventMethod · 0.45

Tested by

no test coverage detected