当前位置: 首页>>代码示例>>Python>>正文


Python QPainterPath.arcTo方法代码示例

本文整理汇总了Python中PySide.QtGui.QPainterPath.arcTo方法的典型用法代码示例。如果您正苦于以下问题:Python QPainterPath.arcTo方法的具体用法?Python QPainterPath.arcTo怎么用?Python QPainterPath.arcTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtGui.QPainterPath的用法示例。


在下文中一共展示了QPainterPath.arcTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: updatePath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [as 别名]
 def updatePath(self):
     """
     TOWRITE
     """
     path = QPainterPath()
     r = self.rect()  # QRectF
     path.arcMoveTo(r, 0)
     path.arcTo(r, 0, 360)
     # NOTE: Reverse the path so that the inside area isn't considered part of the ellipse
     path.arcTo(r, 0, -360)
     self.setObjectPath(path)
开发者ID:Allen76,项目名称:Embroidermodder,代码行数:13,代码来源:object_ellipse.py

示例2: _setupPainterPath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [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
开发者ID:github-account-because-they-want-it,项目名称:VisualScrape,代码行数:13,代码来源:ui_common.py

示例3: set_shape

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [as 别名]
 def set_shape(self, width, height):
     ''' ANSWER has round, disjoint sides - does not fit in a polygon '''
     self.width, self.height = width, height
     point = 20 #width / 2.85
     path = QPainterPath()
     left = QRect(0, 0, point, height)
     right = QRect(width - point, 0, point, height)
     path.arcMoveTo(left, 125)
     path.arcTo(left, 125, 110)
     path.arcMoveTo(right, -55)
     path.arcTo(right, -55, 110)
     path.moveTo(width, height)
     self.setPath(path)
     super(DecisionAnswer, self).set_shape(width, height)
开发者ID:Kampbell,项目名称:opengeode,代码行数:16,代码来源:sdlSymbols.py

示例4: roundedRectPath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [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
开发者ID:kaijfox,项目名称:Oxide-Gui,代码行数:37,代码来源:style.py

示例5: updatePath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [as 别名]
 def updatePath(self):
     """
     TOWRITE
     """
     path = QPainterPath()
     r = self.rect()  # QRectF
     # Add the center point.
     path.addRect(-0.00000001, -0.00000001, 0.00000002, 0.00000002)
     # Add the circle.
     path.arcMoveTo(r, 0)
     path.arcTo(r, 0, 360)
     # NOTE: Reverse the path so that the inside area isn't considered part of the circle.
     path.arcTo(r, 0, -360)
     self.setObjectPath(path)
开发者ID:Metallicow,项目名称:Embroidermodder,代码行数:16,代码来源:object_circle.py

示例6: objectSavePath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [as 别名]
    def objectSavePath(self):
        """
        TOWRITE

        :rtype: `QPainterPath`_
        """
        path = QPainterPath()
        r = self.rect()  # QRectF
        path.arcMoveTo(r, 0)
        path.arcTo(r, 0, 360)

        s = self.scale()  # qreal
        trans = QTransform()
        trans.rotate(self.rotation())
        trans.scale(s, s)
        return trans.map(path)
开发者ID:Allen76,项目名称:Embroidermodder,代码行数:18,代码来源:object_ellipse.py

示例7: updatePath

# 需要导入模块: from PySide.QtGui import QPainterPath [as 别名]
# 或者: from PySide.QtGui.QPainterPath import arcTo [as 别名]
    def updatePath(self):
        """
        TOWRITE
        """
        startAngle = (self.objectStartAngle() + self.rotation())  # qreal
        spanAngle = self.objectIncludedAngle()                    # qreal

        if self.objectClockwise():
            spanAngle = -spanAngle

        path = QPainterPath()
        path.arcMoveTo(self.rect(), startAngle)
        path.arcTo(self.rect(), startAngle, spanAngle)
        # NOTE: Reverse the path so that the inside area isn't considered part of the arc
        path.arcTo(self.rect(), startAngle + spanAngle, -spanAngle);
        self.setObjectPath(path)
开发者ID:Drahflow,项目名称:Embroidermodder,代码行数:18,代码来源:object_arc.py


注:本文中的PySide.QtGui.QPainterPath.arcTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。