本文整理汇总了Python中PySide.QtGui.QPainterPath.closeSubpath方法的典型用法代码示例。如果您正苦于以下问题:Python QPainterPath.closeSubpath方法的具体用法?Python QPainterPath.closeSubpath怎么用?Python QPainterPath.closeSubpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QPainterPath
的用法示例。
在下文中一共展示了QPainterPath.closeSubpath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: roundedRectPath
# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import closeSubpath [as 别名]
def roundedRectPath(x,y,width,height,
TLRX,TLRY, TRRX,TRRY,
BLRX,BLRY, BRRX,BRRY):
right = x + width
bottom = y + height
if TLRX <= 0: TLRX = 0.1
if TLRY <= 0: TLRY = 0.1
if TRRX <= 0: TRRX = 0.1
if TRRY <= 0: TRRY = 0.1 # path cannot handle 0
if BLRX <= 0: BLRX = 0.1 # as rounding values
if BLRY <= 0: BLRY = 0.1
if BRRX <= 0: BRRX = 0.1
if BRRY <= 0: BRRY = 0.1
path = QPainterPath(QPointF(x,y))
path.arcTo(x, y,
TLRX * 2.0, TLRY * 2.0,
180.0, -90.0);
path.arcTo(right - TRRX * 2.0, y,
TRRX * 2.0, TRRY * 2.0,
90.0, -90.0);
path.arcTo(right - BRRX * 2.0, bottom - BRRY * 2.0,
BRRX * 2.0, BRRY * 2.0,
0.0 , -90.0);
path.arcTo(x, bottom - BLRY * 2.0,
BLRX * 2.0, BLRY * 2.0,
-90.0, -90.0);
path.closeSubpath()
return path
示例2: _setupPainterPath
# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import closeSubpath [as 别名]
def _setupPainterPath(self):
painter_path = QPainterPath()
painter_path.moveTo(0, 15) #left
painter_path.lineTo(0, 0) #up
painter_path.lineTo(self.width() - 1, 0) # right
painter_path.lineTo(self.width() - 1, 15) # down
painter_path.arcTo(QRect(self.width() - 6, 15, 5, 4), 0, -90) # control point1, cp2, destPoint
painter_path.lineTo(5, 19) # left
painter_path.arcTo(QRect(1, 15, 5, 4), 270, -90) #arc left up
painter_path.closeSubpath()
self._painter_path = painter_path