MCPcopy Create free account
hub / github.com/KDE/labplot / mouseReleaseEvent

Method mouseReleaseEvent

src/frontend/worksheet/WorksheetView.cpp:922–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920}
921
922void WorksheetView::mouseReleaseEvent(QMouseEvent* event) {
923 if (event->button() == Qt::LeftButton && m_mouseMode == MouseMode::ZoomSelection) {
924 m_selectionBandIsShown = false;
925 viewport()->repaint(QRect(m_selectionStart, m_selectionEnd).normalized());
926
927 // don't zoom if very small region was selected, avoid occasional/unwanted zooming
928 m_selectionEnd = event->pos();
929 if (abs(m_selectionEnd.x() - m_selectionStart.x()) > 20 && abs(m_selectionEnd.y() - m_selectionStart.y()) > 20)
930 fitInView(mapToScene(QRect(m_selectionStart, m_selectionEnd).normalized()).boundingRect(), Qt::KeepAspectRatio);
931 }
932
933 QGraphicsView::mouseReleaseEvent(event);
934}
935
936void WorksheetView::mouseDoubleClickEvent(QMouseEvent*) {
937 Q_EMIT propertiesExplorerRequested();

Callers

nothing calls this directly

Calls 4

buttonMethod · 0.80
xMethod · 0.80
yMethod · 0.45
boundingRectMethod · 0.45

Tested by

no test coverage detected