MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / widgetMouseMoveEvent

Method widgetMouseMoveEvent

pj_plotting/widget/src/PlotZoomer.cpp:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void PlotZoomer::widgetMouseMoveEvent(QMouseEvent* event) {
35 if (mouse_pressed_) {
36 const QRect rect(event->pos(), initial_pos_);
37 const QRectF zoom_rect = invTransform(rect.normalized());
38 if (zoom_rect.width() > minZoomSize().width() && zoom_rect.height() > minZoomSize().height()) {
39 if (!zoom_enabled_) {
40 const QPixmap& pixmap = loadSvg(":/resources/svg/zoom_in.svg", currentTheme());
41 QApplication::setOverrideCursor(QCursor(pixmap.scaled(24, 24)));
42 zoom_enabled_ = true;
43 setRubberBand(RectRubberBand);
44 setTrackerMode(AlwaysOff);
45 setRubberBandPen(QPen(parentWidget()->palette().windowText().color(), 1, Qt::DashLine));
46 }
47 } else if (zoom_enabled_) {
48 zoom_enabled_ = false;
49 setRubberBand(NoRubberBand);
50 QApplication::restoreOverrideCursor();
51 }
52 }
53 QwtPlotPicker::widgetMouseMoveEvent(event);
54}
55
56void PlotZoomer::widgetMouseReleaseEvent(QMouseEvent* event) {
57 mouse_pressed_ = false;

Callers

nothing calls this directly

Calls 9

currentThemeFunction · 0.85
QCursorClass · 0.85
heightMethod · 0.80
paletteMethod · 0.80
QPenClass · 0.50
posMethod · 0.45
normalizedMethod · 0.45
widthMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected