Free selection : minor

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5733 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-02-04 20:43:58 +00:00
parent ae68f08bb6
commit 481dda8477

View File

@@ -540,18 +540,21 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e)
} }
} }
//Popup a menu with an action to create conductors between if (m_free_rubberband.count() > 3)
//all selected terminals.
QAction *act = new QAction(tr("Connecter les bornes sélectionné"), this);
QPolygonF polygon_ = m_free_rubberband;
connect(act, &QAction::triggered, [this, polygon_]()
{ {
ConductorCreator::create(m_diagram, polygon_); //Popup a menu with an action to create conductors between
diagram()->clearSelection(); //all selected terminals.
}); QAction *act = new QAction(tr("Connecter les bornes sélectionné"), this);
QMenu *menu = new QMenu(this); QPolygonF polygon_ = m_free_rubberband;
menu->addAction(act); connect(act, &QAction::triggered, [this, polygon_]()
menu->popup(e->globalPos()); {
ConductorCreator::create(m_diagram, polygon_);
diagram()->clearSelection();
});
QMenu *menu = new QMenu(this);
menu->addAction(act);
menu->popup(e->globalPos());
}
m_free_rubberbanding = false; m_free_rubberbanding = false;
m_free_rubberband = QPolygon(); m_free_rubberband = QPolygon();