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

Method mousePressEvent

pj_plotting/widget/src/DockToolbar.cpp:92–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void DockToolbar::mousePressEvent(QMouseEvent* ev) {
93 if (auto* area = parent_dock_->dockAreaWidget()) {
94 // Forward with synthetic pos (0, 0). CFloatingDragPreview positions its
95 // top-left at QCursor::pos() - DragStartMousePosition, so a (0, 0) start
96 // makes the preview track the cursor directly instead of being offset by
97 // wherever the user happened to click along the wide toolbar.
98 QMouseEvent fwd(
99 QEvent::MouseButtonPress, QPointF(0, 0), ev->globalPosition(), ev->button(), ev->buttons(), ev->modifiers());
100 QCoreApplication::sendEvent(area->titleBar(), &fwd);
101 ev->setAccepted(fwd.isAccepted());
102 }
103}
104
105void DockToolbar::mouseReleaseEvent(QMouseEvent* ev) {
106 if (auto* area = parent_dock_->dockAreaWidget()) {

Callers

nothing calls this directly

Calls 2

titleBarMethod · 0.80
QPointFClass · 0.50

Tested by

no test coverage detected