mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 08:40:53 +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:
@@ -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_);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user