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

@@ -57,21 +57,9 @@ TerminalStripEditor::TerminalStripEditor(QETProject *project, QWidget *parent) :
{
if (m_model->columnTypeForIndex(index) == TerminalStripModel::XRef)
{
auto mrtd = m_model->modelRealTerminalDataForIndex(index);
if (mrtd.element_)
{
auto elmt = mrtd.element_;
auto diagram = elmt->diagram();
if (diagram)
{
diagram->showMe();
if (diagram->views().size())
{
auto fit_view = elmt->sceneBoundingRect();
fit_view.adjust(-200,-200,200,200);
diagram->views().at(0)->fitInView(fit_view, Qt::KeepAspectRatioByExpanding);
}
}
const auto mrtd = m_model->modelRealTerminalDataForIndex(index);
if (mrtd.element_) {
QetGraphicsItem::showItem(mrtd.element_);
}
}
});