當前位置: 首頁>>代碼示例>>Python>>正文


Python QPen.setStyle方法代碼示例

本文整理匯總了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
開發者ID:AEliu,項目名稱:calibre,代碼行數:12,代碼來源:document.py

示例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)
開發者ID:cyril711,項目名稱:git-MythicWar,代碼行數:26,代碼來源:map_item.py


注:本文中的PyQt5.Qt.QPen.setStyle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。