refactor[deiagram editor]: mutualize code.

The features used to jump to linked element and xref now use the same
function.
This commit is contained in:
joshua
2025-10-20 22:58:12 +02:00
parent f74fed9f3f
commit e26f7fdaaa
3 changed files with 6 additions and 45 deletions

View File

@@ -320,24 +320,7 @@ void CrossRefItem::paint(
void CrossRefItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
event->accept();
if (m_hovered_contact && m_hovered_contact->scene())
{
//Show and select the linked slave element
if (scene() != m_hovered_contact->scene())
{
m_hovered_contact->diagram()->showMe();
}
m_hovered_contact->setSelected(true);
//Zoom to the linked slave element
foreach(QGraphicsView *view,
m_hovered_contact->diagram()->views())
{
QRectF fit = m_hovered_contact->sceneBoundingRect();
fit.adjust(-200, -200, 200, 200);
view->fitInView(fit, Qt::KeepAspectRatioByExpanding);
}
}
QetGraphicsItem::showItem(m_hovered_contact);
}
/**