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


Python QPainterPath.addRoundedRect方法代碼示例

本文整理匯總了Python中PyQt5.Qt.QPainterPath.addRoundedRect方法的典型用法代碼示例。如果您正苦於以下問題:Python QPainterPath.addRoundedRect方法的具體用法?Python QPainterPath.addRoundedRect怎麽用?Python QPainterPath.addRoundedRect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.Qt.QPainterPath的用法示例。


在下文中一共展示了QPainterPath.addRoundedRect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: paint_background

# 需要導入模塊: from PyQt5.Qt import QPainterPath [as 別名]
# 或者: from PyQt5.Qt.QPainterPath import addRoundedRect [as 別名]
 def paint_background(self, painter):
     br = 12  # border_radius
     bw = 1  # border_width
     c = QColor('#fdfd96')
     p = QPainterPath()
     p.addRoundedRect(QRectF(self.rect()), br, br)
     painter.fillPath(p, c)
     p.addRoundedRect(QRectF(self.rect()).adjusted(bw, bw, -bw, -bw), br, br)
     painter.fillPath(p, QColor('black'))
開發者ID:kovidgoyal,項目名稱:vise,代碼行數:11,代碼來源:popup.py

示例2: paint_background

# 需要導入模塊: from PyQt5.Qt import QPainterPath [as 別名]
# 或者: from PyQt5.Qt.QPainterPath import addRoundedRect [as 別名]
 def paint_background(self, painter):
     br = 12  # border_radius
     bw = 1  # border_width
     pal = self.palette()
     c = pal.color(pal.Window)
     c.setAlphaF(0.9)
     p = QPainterPath()
     p.addRoundedRect(QRectF(self.rect()), br, br)
     painter.fillPath(p, c)
     p.addRoundedRect(QRectF(self.rect()).adjusted(bw, bw, -bw, -bw), br, br)
     painter.fillPath(p, pal.color(pal.WindowText))
開發者ID:j-howell,項目名稱:calibre,代碼行數:13,代碼來源:proceed.py

示例3: __call__

# 需要導入模塊: from PyQt5.Qt import QPainterPath [as 別名]
# 或者: from PyQt5.Qt.QPainterPath import addRoundedRect [as 別名]
 def __call__(self, painter, rect, color_theme, title_block, subtitle_block, footer_block):
     painter.fillRect(rect, self.color1)
     r = QRect(0, int(title_block.position.y), rect.width(),
               title_block.height + subtitle_block.height + subtitle_block.line_spacing // 2 + title_block.leading)
     painter.save()
     p = QPainterPath()
     p.addRoundedRect(QRectF(r), 10, 10 * r.width()/r.height(), Qt.RelativeSize)
     painter.setClipPath(p)
     painter.setRenderHint(QPainter.Antialiasing)
     painter.fillRect(r, self.color2)
     painter.restore()
     r = QRect(0, 0, int(title_block.position.x), rect.height())
     painter.fillRect(r, self.color2)
     return self.ccolor2, self.ccolor2, self.ccolor1
開發者ID:artbycrunk,項目名稱:calibre,代碼行數:16,代碼來源:covers.py


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