def __init__(self, w, h, fgcolor): QGraphicsLineItem.__init__(self) self.setLine(w / 2., 0, w / 2., h) if fgcolor: self.setPen(QPen(QColor(fgcolor))) else: self.setPen(QPen(QColor('#000000')))
def __init__(self, parent, fromView, toView, distributedObjects): """ Constructor @param parent parent for the QGraphicsPolygonItem-Constructor @param fromView datagraph.htmlvariableview.HtmlVariableView, starting point of the Pointer @param toView datagraph.htmlvariableview.HtmlVariableView, end point of the Pointer @param distributedObjects distributedobjects.DistributedObjects, the DistributedObjects-Instance fromView and toView are QGraphicsWebViews """ QGraphicsLineItem.__init__(self, parent) self.fromView = fromView fromView.addOutgoingPointer(self) self.toView = toView toView.addIncomingPointer(self) #self.setBrush( QBrush( self.bgcolor ) ) self.setPen(QPen(self.fgcolor, 1)) self.distributedObjects = distributedObjects QObject.connect(self.fromView, SIGNAL('geometryChanged()'), self.updatePosition) QObject.connect(self.toView, SIGNAL('geometryChanged()'), self.updatePosition) QObject.connect(self.fromView, SIGNAL('xChanged()'), self.updatePosition) QObject.connect(self.fromView, SIGNAL('yChanged()'), self.updatePosition) QObject.connect(self.toView, SIGNAL('xChanged()'), self.updatePosition) QObject.connect(self.toView, SIGNAL('yChanged()'), self.updatePosition) QObject.connect(self.fromView, SIGNAL('removing()'), self.delete) QObject.connect(self.toView, SIGNAL('removing()'), self.delete) self.arrowhead = QPolygonF() self.arrowSize = 20 self.setZValue(-1) # paint the arrows behind (lower z-value) everything else
def __init__ (self, s_in, s_out ,parent=None, scene=None): QGraphicsLineItem.__init__ (self) self.s_in = s_in self.s_out = s_out self.comm = c0.Comm0 () self.xo = self.s_in.getAbsPos().x() self.yo = self.s_in.getAbsPos().y() self.xf = self.s_out.getAbsPos().x() self.yf = self.s_out.getAbsPos().y() self.color = QColor (Qt.green).dark(120) #self.setFlags (QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable) #self.setAcceptsHoverEvents (True) self.setZValue (-1) self.arrowSize = 5 self.arrowHead = QPolygonF() self.setFlags (QGraphicsItem.ItemIsSelectable) self.setAcceptHoverEvents (True) self.setActive(True) self.wire_pen = QPen (Qt.white, 3, Qt.DotLine) # Qt.SolidLine self.const = 3
def __init__(self, parent, fromView, toView, distributedObjects): """ Constructor @param parent parent for the QGraphicsPolygonItem-Constructor @param fromView datagraph.htmlvariableview.HtmlVariableView, starting point of the Pointer @param toView datagraph.htmlvariableview.HtmlVariableView, end point of the Pointer @param distributedObjects distributedobjects.DistributedObjects, the DistributedObjects-Instance fromView and toView are QGraphicsWebViews """ QGraphicsLineItem.__init__(self, parent) self.fromView = fromView fromView.addOutgoingPointer(self) self.toView = toView toView.addIncomingPointer(self) self.setPen(QPen(self.fgcolor, 1)) self.distributedObjects = distributedObjects self.fromView.geometryChanged.connect(self.updatePosition) self.toView.geometryChanged.connect(self.updatePosition) self.fromView.xChanged.connect(self.updatePosition) self.fromView.yChanged.connect(self.updatePosition) self.toView.xChanged.connect(self.updatePosition) self.toView.yChanged.connect(self.updatePosition) self.fromView.removing.connect(self.delete) self.toView.removing.connect(self.delete) self.arrowhead = QPolygonF() self.arrowSize = 20 self.setZValue( -1) # paint the arrows behind (lower z-value) everything else
def __init__(self, rl): QGraphicsLineItem.__init__(self, 0, 0, rl.linelength, 0) ContentObject.__init__(self) self.setPen(QPen( COLOR(rl.linecolor, None), rl.linewidth, ))
def __init__(self, lon0, lat0, lon1, lat1, scene, parent=None): QGraphicsLineItem.__init__(self, parent=parent, scene=scene) self._lon0 = lon0 self._lat0 = lat0 self._lon1 = lon1 self._lat1 = lat1 self.updatePosition(scene)
def __init__(self, scene, *args, **kwords): comp.__init__(self, *args, **kwords) QGraphicsLineItem.__init__(self,QLineF(), scene = scene) pen = QtGui.QPen() pen.setWidth(1) pen.setBrush(Qt.black) pen.setStyle(Qt.NoPen) self.setPen(pen) self.nextPoint = 1
def __init__(self, sourceItem, destItem, colorStr="#A5A2A5", arrowWidth=1): QGraphicsLineItem.__init__(self) color = QColor(0, 0, 0) color.setNamedColor(colorStr) self.arrowWidth = arrowWidth self.arrowColor = color self.sourceItem = sourceItem self.destItem = destItem self.setTestLine()
def __init__(self, x0, y0, x1, y1): '''constructor ''' QGraphicsLineItem.__init__ (self) self.setZValue (2000) self.x0 = x0 self.y0 = y0 self.x1 = x1 self.y1 = y1 self.cx = 2 self.cy = 2
def __init__(self, node1, node2, parent = None, scene = None): self.node1 = node1 self.node2 = node2 x1 = node1.centerX() y1 = node1.centerY() x2 = node2.centerX() y2 = node2.centerY() QGraphicsLineItem.__init__( self, x1, y1, x2, y2, parent, scene )
def __init__(self, from_table, to_table, condition): QGraphicsLineItem.__init__(self) self.instances.append(self) # from/to table connections self.from_table = from_table self.to_table = to_table self.condition = condition from_table.table_move.connect(self.update_spring) to_table.table_move.connect(self.update_spring) # draw arrow self.arrow = ArrowPolygonItem(self) self.arrow.clicked.connect(self.change_settings) # set attributes pen = QPen() pen.setWidth(2) self.setPen(pen) self.update_spring() self.setZValue(-1) # setup configuration menu menu = QMenu() join_action = QAction('Join', menu) join_action.setCheckable(True) join_action.setChecked(True) outer_join_action = QAction('Outer Join', menu) outer_join_action.setCheckable(True) group = QActionGroup(menu) group.addAction(join_action) group.addAction(outer_join_action) menu.addAction(join_action) menu.addAction(outer_join_action) self.join_action = join_action self.outer_join_action = outer_join_action self.menu = menu
def __init__(self, rl): QGraphicsLineItem.__init__(self, 0, 0, rl.linelength, 0) ContentObject.__init__(self) self.setPen(QPen(COLOR(rl.linecolor, None), rl.linewidth))
def __init__(self, *args, **kwargs): QGraphicsLineItem.__init__(self, *args) GraphEdge.__init__(self, **kwargs) self.setZValue(-30)