Mercurial > lcfOS
changeset 59:f6ea630c4057
Cleanup
author | windel |
---|---|
date | Tue, 24 Apr 2012 08:01:55 +0200 |
parents | 65acf6874a8d |
children | b976546f5a60 |
files | applications/lab/diagrameditor.py |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/applications/lab/diagrameditor.py Tue Apr 24 07:56:51 2012 +0200 +++ b/applications/lab/diagrameditor.py Tue Apr 24 08:01:55 2012 +0200 @@ -56,10 +56,8 @@ l2 = QLineF(p1, pos) l3 = QLineF(pos, p2) d = l1.length() - l2.length() - l3.length() - print(idx, d) - if d > -1: + if d > -3: tidx = idx - print('got:', tidx) idx += 1 hi = HandleItem(self) self.vias.insert(tidx, hi) @@ -109,15 +107,12 @@ """ if self.pos1 is None or self.pos2 is None: return - pts = [self.pos1] + [v.pos() for v in self.vias] + [self.pos2] - self.arrowhead.setPos(self.pos2) if pts[-1].x() < pts[-2].x(): self.arrowhead.setRotation(-90) else: self.arrowhead.setRotation(90) - path = QPainterPath(pts[0]) for pt in pts[1:]: path.lineTo(pt) @@ -277,6 +272,8 @@ def editParameters(self): pd = ParameterDialog(self, self.window()) pd.exec_() + def mouseDoubleClickEvent(self, event): + self.editParameters() def newInputPort(self): names = [i.name for i in self.inputs + self.outputs] self.addInput(PortItem(uniqify('in', names), self, 'input'))