本文整理汇总了Python中PyQt5.Qt.QPen.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Python QPen.setStyle方法的具体用法?Python QPen.setStyle怎么用?Python QPen.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QPen
的用法示例。
在下文中一共展示了QPen.setStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.Qt import QPen [as 别名]
# 或者: from PyQt5.Qt.QPen import setStyle [as 别名]
def __init__(self, font_loader, logger, opts, width=0, height=0, parent=None, x=0, y=0):
QGraphicsRectItem.__init__(self, x, y, width, height, parent)
self.font_loader, self.logger, self.opts = font_loader, logger, opts
self.current_y, self.max_y, self.max_x = 0, height, width
self.is_full = False
pen = QPen()
pen.setStyle(Qt.NoPen)
self.setPen(pen)
if not hasattr(self, 'children'):
self.children = self.childItems
示例2: paint
# 需要导入模块: from PyQt5.Qt import QPen [as 别名]
# 或者: from PyQt5.Qt.QPen import setStyle [as 别名]
def paint (self,painter,option, widget):
painter.setRenderHints(QtGui.QPainter.Antialiasing)
pen = QPen(self.color)
pen.setWidth(2)
pen.setStyle(QtCore.Qt.DashLine)
painter.setPen(pen)
for action in self.liste_actions.values() :
if action.isActive():
if type(action) == ActionMoveToPosition:
i = 0
for heros in action.list_left:
start_x, start_y = self.scene_coord.LatLonToScene(heros.attribs['latitude'], heros.attribs['longitude'])
destination = action.list_right[i]
end_x,end_y = self.scene_coord.LatLonToScene(destination.x(), destination.y())
i = (i +1)%len(action.list_right)
self.setPos(QPointF(start_x,start_y))
dest = self.view.mapFromScene(QPoint(end_x,end_y))
str = self.view.mapFromScene(QPoint(start_x,start_y))
dest = dest-str
painter.drawLine(QPointF(0,0),dest)