MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / mouseMoveEvent

Method mouseMoveEvent

QtNodeEditor/src/NodeGraphicsObject.cpp:266–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265
266void
267NodeGraphicsObject::
268mouseMoveEvent(QGraphicsSceneMouseEvent * event)
269{
270 auto & geom = _node.nodeGeometry();
271 auto & state = _node.nodeState();
272
273 if (state.resizing())
274 {
275 auto diff = event->pos() - event->lastPos();
276
277 if (auto w = _node.nodeDataModel()->embeddedWidget())
278 {
279 prepareGeometryChange();
280
281 auto oldSize = w->size();
282
283 oldSize += QSize(diff.x(), diff.y());
284
285 w->setFixedSize(oldSize);
286
287 _proxyWidget->setMinimumSize(oldSize);
288 _proxyWidget->setMaximumSize(oldSize);
289 _proxyWidget->setPos(geom.widgetPosition());
290
291 geom.recalculateSize();
292 update();
293
294 moveConnections();
295
296 event->accept();
297 }
298 }
299 else
300 {
301 QGraphicsObject::mouseMoveEvent(event);
302
303 if (event->lastPos() != event->pos())
304 moveConnections();
305
306 event->ignore();
307 }
308
309 QRectF r = scene()->sceneRect();
310
311 r = r.united(mapToScene(boundingRect()).boundingRect());
312
313 scene()->setSceneRect(r);
314}
315
316
317void

Callers

nothing calls this directly

Calls 1

embeddedWidgetMethod · 0.80

Tested by

no test coverage detected