本文整理汇总了Python中PyQt4.QtCore.QLineF.setX方法的典型用法代码示例。如果您正苦于以下问题:Python QLineF.setX方法的具体用法?Python QLineF.setX怎么用?Python QLineF.setX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QLineF
的用法示例。
在下文中一共展示了QLineF.setX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: paint
# 需要导入模块: from PyQt4.QtCore import QLineF [as 别名]
# 或者: from PyQt4.QtCore.QLineF import setX [as 别名]
def paint(self, painter, option, widget=None):
painter.setPen(self.pen())
if not self.__arrowed:
headCenter = self.mapFromItem(self.__head[ENode.kGuiAttributeParent],
self.__head[ENode.kGuiAttributeParent].boundingRect().center())
tailCenter = self.mapFromItem(self.__tail[ENode.kGuiAttributeParent],
self.__tail[ENode.kGuiAttributeParent].boundingRect().center())
centerPoint = QLineF(headCenter, tailCenter).pointAt(0.5)
centerPoint.setX(self.__headOffsetLine.p2().x())
centerPoint.setX(self.__tailOffsetLine.p2().x())
painter.drawPath(self.drawPath(self.__headOffsetLine.p1(), self.__tailOffsetLine.p1())[0])
else:
painter.drawLine(self.__line)
painter.setPen(Qt.NoPen)
painter.setBrush(QColor(43, 43, 43))
headCutPoint = self.getIntersectPoint(self.__head[ENode.kGuiAttributeParent].Polygon,
self.__line.p1(), self.__line.p2())
tailCutPoint = self.getIntersectPoint(self.__tail[ENode.kGuiAttributeParent].Polygon,
self.__line.p2(), self.__line.p1())
painter.drawPolygon(self.getArrow(QLineF(headCutPoint, tailCutPoint)))
示例2: paint
# 需要导入模块: from PyQt4.QtCore import QLineF [as 别名]
# 或者: from PyQt4.QtCore.QLineF import setX [as 别名]
def paint(self, painter, option, widget=None):
painter.setPen(self.pen())
headCenter = self.mapFromItem(self.__head[ENode.kGuiAttributeParent],
self.__head[ENode.kGuiAttributeParent].boundingRect().center())
tailCenter = self.mapFromItem(self.__tail[ENode.kGuiAttributeParent],
self.__tail[ENode.kGuiAttributeParent].boundingRect().center())
centerPoint = QLineF(headCenter, tailCenter).pointAt(0.5)
centerPoint.setX(self.__headOffsetLine.p2().x())
lineFromHead = QLineF(self.__headOffsetLine.p2(), centerPoint)
centerPoint.setX(self.__tailOffsetLine.p2().x())
lineFromTail = QLineF(self.__tailOffsetLine.p2(), centerPoint)
painter.drawPath(self.drawPath(self.__headOffsetLine.p1(), self.__tailOffsetLine.p1())[0])