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

Method mousePressEvent

qt/draw_widget.cpp:256–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void DrawWidget::mousePressEvent(QMouseEvent * e)
257{
258 if (m_screenshotMode)
259 return;
260
261 QOpenGLWidget::mousePressEvent(e);
262
263 m2::PointD const pt = GetDevicePoint(e);
264
265 if (IsLeftButton(e))
266 {
267 if (IsShiftModifier(e))
268 SubmitRoutingPoint(pt, false);
269 else if (m_ruler.IsActive() && IsAltModifier(e))
270 SubmitRulerPoint(pt);
271 else if (IsAltModifier(e))
272 SubmitFakeLocationPoint(pt);
273 else
274 m_framework.TouchEvent(GetDfTouchEventFromQMouseEvent(e, df::TouchEvent::TOUCH_DOWN));
275 }
276 else if (IsRightButton(e))
277 {
278 if (IsAltModifier(e))
279 {
280 SubmitBookmark(pt);
281 }
282 else if (!m_selectionMode || IsCommandModifier(e))
283 {
284 ShowInfoPopup(e, pt);
285 }
286 else
287 {
288 m_rubberBandOrigin = e->pos();
289 if (m_rubberBand == nullptr)
290 m_rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
291 m_rubberBand->setGeometry(QRect(m_rubberBandOrigin, QSize()));
292 m_rubberBand->show();
293 }
294 }
295}
296
297void DrawWidget::mouseMoveEvent(QMouseEvent * e)
298{

Callers

nothing calls this directly

Calls 8

IsLeftButtonFunction · 0.85
IsShiftModifierFunction · 0.85
IsAltModifierFunction · 0.85
IsRightButtonFunction · 0.85
IsCommandModifierFunction · 0.85
IsActiveMethod · 0.45
TouchEventMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected