本文整理汇总了Python中AnyQt.QtGui.QPen.setJoinStyle方法的典型用法代码示例。如果您正苦于以下问题:Python QPen.setJoinStyle方法的具体用法?Python QPen.setJoinStyle怎么用?Python QPen.setJoinStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtGui.QPen
的用法示例。
在下文中一共展示了QPen.setJoinStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from AnyQt.QtGui import QPen [as 别名]
# 或者: from AnyQt.QtGui.QPen import setJoinStyle [as 别名]
def __init__(self, source, dest):
super().__init__()
self.setAcceptedMouseButtons(Qt.LeftButton)
self.setCacheMode(self.DeviceCoordinateCache) # Without this, burn thy CPU
self.setZValue(1)
pen = QPen(Edge.Color.DEFAULT[0], 1)
pen.setJoinStyle(Qt.MiterJoin)
self.setPen(pen)
self.arrowHead = QPolygonF()
self._selected = False
self._weights = []
self._labels = []
self.squares = GroupOfSquares(self)
self.source = source
self.dest = dest
if source is dest:
source.edges.append(self)
else:
source.edges.insert(0, self)
dest.edges.insert(0, self)
# Add text labels
label = self.label = TextItem('', self)
label.setFont(Edge.Font.DEFAULT)
label.setZValue(3)
self.adjust()
示例2: paint
# 需要导入模块: from AnyQt.QtGui import QPen [as 别名]
# 或者: from AnyQt.QtGui.QPen import setJoinStyle [as 别名]
def paint(self, painter, option, widget=None):
# Override the default selected appearance
if self.isSelected():
option.state ^= QStyle.State_Selected
rect = self.rect()
# this must render before overlay due to order in which it's drawn
super().paint(painter, option, widget)
painter.save()
pen = QPen(QColor(Qt.black))
pen.setWidth(4)
pen.setJoinStyle(Qt.MiterJoin)
painter.setPen(pen)
painter.drawRect(rect.adjusted(2, 2, -2, -2))
painter.restore()
else:
super().paint(painter, option, widget)