本文整理汇总了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
示例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
示例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')))
示例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
示例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)
示例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
示例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
)
示例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
示例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))