mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-30 07:40:51 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user