# HG changeset patch # User windel # Date 1335247315 -7200 # Node ID f6ea630c4057e04d08439e17fd743f3f950b4892 # Parent 65acf6874a8d63e67058416eaa7933fed34b43e7 Cleanup diff -r 65acf6874a8d -r f6ea630c4057 applications/lab/diagrameditor.py --- 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'))