void SketchWidget::hoverEnterItem(QGraphicsSceneHoverEvent * event, ItemBase * item) { if(m_infoViewOnHover || currentlyInfoviewed(item)) { InfoGraphicsView::hoverEnterItem(event, item); } Wire * wire = dynamic_cast<Wire *>(item); if (wire != NULL) { if (canChainWire(wire)) { bool segment = wire->connector0()->chained() && wire->connector1()->chained(); bool disconnected = wire->connector0()->connectionsCount() == 0 && wire->connector1()->connectionsCount() == 0; statusMessage(QString("%1 to add a bendpoint %2") .arg(disconnected ? tr("Double-click") : tr("Drag or double-click")) .arg(segment ? tr("or alt-drag to move the segment") : tr(""))); m_lastHoverEnterItem = item; } }}
void QGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent){ Q_D(QGraphicsScene); if (d->mouseGrabberItems.isEmpty()) { if (mouseEvent->buttons()) return; QGraphicsSceneHoverEvent hover; _q_hoverFromMouseEvent(&hover, mouseEvent); mouseEvent->setAccepted(d->dispatchHoverEvent(&hover)); return; } // Forward the event to the mouse grabber d->sendMouseEvent(mouseEvent); mouseEvent->accept();}
if (mouseEvent->buttons()) return;
QMouseEvent customEvent(event->type(), event->pos(), Qt::NoButton, Qt::NoButton, event->modifiers()); QGraphicsView::mouseMoveEvent(&customEvent);