本文整理匯總了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)