当前位置: 首页>>代码示例>>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;未经允许,请勿转载。