当前位置: 首页>>代码示例>>Python>>正文


Python QGraphicsLineItem.__init__方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QGraphicsLineItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsLineItem.__init__方法的具体用法?Python QGraphicsLineItem.__init__怎么用?Python QGraphicsLineItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QGraphicsLineItem的用法示例。


在下文中一共展示了QGraphicsLineItem.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
    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
开发者ID:gledr,项目名称:ricodebug,代码行数:32,代码来源:pointer.py

示例2: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
 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
开发者ID:iras,项目名称:JADE,代码行数:33,代码来源:Wires0.py

示例3: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
 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')))
开发者ID:UdeM-LBIT,项目名称:CoreTracker,代码行数:9,代码来源:Faces.py

示例4: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
        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
开发者ID:Rosslaew,项目名称:Archsim,代码行数:13,代码来源:graphical.py

示例5: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
    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)
开发者ID:rugolotti,项目名称:PyTileMap,代码行数:11,代码来源:mapitems.py

示例6: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
 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
开发者ID:iras,项目名称:JADE,代码行数:16,代码来源:Utility0.py

示例7: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
    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
                )
开发者ID:karolszczapa,项目名称:GIS,代码行数:20,代码来源:Edge.py

示例8: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
    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
开发者ID:richardmurri,项目名称:Query-Browser,代码行数:40,代码来源:scene.py

示例9: __init__

# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import __init__ [as 别名]
 def __init__(self, rl):
     QGraphicsLineItem.__init__(self, 0, 0, rl.linelength, 0)
     ContentObject.__init__(self)
     self.setPen(QPen(COLOR(rl.linecolor, None), rl.linewidth))
开发者ID:Eksmo,项目名称:calibre,代码行数:6,代码来源:document.py


注:本文中的PyQt4.QtGui.QGraphicsLineItem.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。