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


Python QRectF.setCoords方法代码示例

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


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

示例1: setCornerRects

# 需要导入模块: from qwt.qt.QtCore import QRectF [as 别名]
# 或者: from qwt.qt.QtCore.QRectF import setCoords [as 别名]
 def setCornerRects(self, path):
     pos = QPointF(0., 0.)
     for i in range(path.elementCount()):
         el = path.elementAt(i)
         if el.type in (QPainterPath.MoveToElement,
                        QPainterPath.LineToElement):
             pos.setX(el.x)
             pos.setY(el.y)
         elif el.type == QPainterPath.CurveToElement:
             r = QRectF(pos, QPointF(el.x, el.y))
             self.clipRects += [r.normalized()]
             pos.setX(el.x)
             pos.setY(el.y)
         elif el.type == QPainterPath.CurveToDataElement:
             if self.clipRects:
                 r = self.clipRects[-1]
                 r.setCoords(min([r.left(), el.x]),
                             min([r.top(), el.y]),
                             max([r.right(), el.x]),
                             max([r.bottom(), el.y]))
                 self.clipRects[-1] = r.normalized()
开发者ID:petebachant,项目名称:python-qwt,代码行数:23,代码来源:plot_canvas.py


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