本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsLineItem.setTransformOriginPoint方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsLineItem.setTransformOriginPoint方法的具体用法?Python QGraphicsLineItem.setTransformOriginPoint怎么用?Python QGraphicsLineItem.setTransformOriginPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QGraphicsLineItem
的用法示例。
在下文中一共展示了QGraphicsLineItem.setTransformOriginPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createArrow
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsLineItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import setTransformOriginPoint [as 别名]
def createArrow(self):
rad = self._RADIUS
pen = QPen()
pen.setWidth(3)
color = QColor(Qt.blue)
color.setAlphaF(0.25)
pen.setBrush(color)
if self._virtual_helix.isEvenParity():
arrow = QGraphicsLineItem(rad, rad, 2*rad, rad, self)
else:
arrow = QGraphicsLineItem(0, rad, rad, rad, self)
arrow.setTransformOriginPoint(rad, rad)
arrow.setZValue(400)
arrow.setPen(pen)
self.arrow = arrow
self.arrow.hide()
示例2: createArrows
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsLineItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import setTransformOriginPoint [as 别名]
def createArrows(self):
rad = _RADIUS
pen1 = self._pen1
pen2 = self._pen2
pen1.setWidth(3)
pen2.setWidth(3)
pen1.setBrush(Qt.gray)
pen2.setBrush(Qt.lightGray)
if self._virtual_helix.isEvenParity():
arrow1 = QGraphicsLineItem(rad, rad, 2*rad, rad, self)
arrow2 = QGraphicsLineItem(0, rad, rad, rad, self)
else:
arrow1 = QGraphicsLineItem(0, rad, rad, rad, self)
arrow2 = QGraphicsLineItem(rad, rad, 2*rad, rad, self)
arrow1.setTransformOriginPoint(rad, rad)
arrow2.setTransformOriginPoint(rad, rad)
arrow1.setZValue(400)
arrow2.setZValue(400)
arrow1.setPen(pen1)
arrow2.setPen(pen2)
self.arrow1 = arrow1
self.arrow2 = arrow2
self.arrow1.hide()
self.arrow2.hide()