<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # QPainterPath Class Reference ## [[QtGui](index.htm) module] 該QPainterPath類提供一個容器,用于繪制操作,從而能夠構造和重用的圖形形狀。[More...](#details) ### Types * `class **[Element](index.htm)**` * `enum ElementType { MoveToElement, LineToElement, CurveToElement, CurveToDataElement }` ### Methods * `__init__ (self)` * `__init__ (self, QPointF?startPoint)` * `__init__ (self, QPainterPath?other)` * `addEllipse (self, QRectF?rect)` * `addEllipse (self, float?x, float?y, float?w, float?h)` * `addEllipse (self, QPointF?center, float?rx, float?ry)` * `addPath (self, QPainterPath?path)` * `addPolygon (self, QPolygonF?polygon)` * `addRect (self, QRectF?rect)` * `addRect (self, float?x, float?y, float?w, float?h)` * `addRegion (self, QRegion?region)` * `addRoundedRect (self, QRectF?rect, float?xRadius, float?yRadius, Qt.SizeMode?mode?=?Qt.AbsoluteSize)` * `addRoundedRect (self, float?x, float?y, float?w, float?h, float?xRadius, float?yRadius, Qt.SizeMode?mode?=?Qt.AbsoluteSize)` * `addRoundRect (self, QRectF?rect, int?xRnd, int?yRnd)` * `addRoundRect (self, float?x, float?y, float?w, float?h, int?xRnd, int?yRnd)` * `addRoundRect (self, QRectF?rect, int?roundness)` * `addRoundRect (self, float?x, float?y, float?w, float?h, int?roundness)` * `addText (self, QPointF?point, QFont?f, QString?text)` * `addText (self, float?x, float?y, QFont?f, QString?text)` * `float angleAtPercent (self, float?t)` * `arcMoveTo (self, QRectF?rect, float?angle)` * `arcMoveTo (self, float?x, float?y, float?w, float?h, float?angle)` * `arcTo (self, QRectF?rect, float?startAngle, float?arcLength)` * `arcTo (self, float?x, float?y, float?w, float?h, float?startAngle, float?arcLenght)` * `QRectF boundingRect (self)` * `closeSubpath (self)` * `connectPath (self, QPainterPath?path)` * `bool contains (self, QPointF?pt)` * `bool contains (self, QRectF?rect)` * `bool contains (self, QPainterPath?p)` * `QRectF controlPointRect (self)` * `cubicTo (self, QPointF?ctrlPt1, QPointF?ctrlPt2, QPointF?endPt)` * `cubicTo (self, float?ctrlPt1x, float?ctrlPt1y, float?ctrlPt2x, float?ctrlPt2y, float?endPtx, float?endPty)` * `QPointF currentPosition (self)` * `Element elementAt (self, int?i)` * `int elementCount (self)` * `Qt.FillRule fillRule (self)` * `QPainterPath intersected (self, QPainterPath?r)` * `bool intersects (self, QRectF?rect)` * `bool intersects (self, QPainterPath?p)` * `bool isEmpty (self)` * `float length (self)` * `lineTo (self, QPointF?p)` * `lineTo (self, float?x, float?y)` * `moveTo (self, QPointF?p)` * `moveTo (self, float?x, float?y)` * `float percentAtLength (self, float?t)` * `QPointF pointAtPercent (self, float?t)` * `quadTo (self, QPointF?ctrlPt, QPointF?endPt)` * `quadTo (self, float?ctrlPtx, float?ctrlPty, float?endPtx, float?endPty)` * `setElementPositionAt (self, int?i, float?x, float?y)` * `setFillRule (self, Qt.FillRule?fillRule)` * `QPainterPath simplified (self)` * `float slopeAtPercent (self, float?t)` * `QPainterPath subtracted (self, QPainterPath?r)` * `QPainterPath subtractedInverted (self, QPainterPath?r)` * `swap (self, QPainterPath?other)` * `QPolygonF toFillPolygon (self, QMatrix?matrix?=?QMatrix())` * `QPolygonF toFillPolygon (self, QTransform?matrix)` * `list-of-QPolygonF toFillPolygons (self, QMatrix?matrix?=?QMatrix())` * `list-of-QPolygonF toFillPolygons (self, QTransform?matrix)` * `QPainterPath toReversed (self)` * `list-of-QPolygonF toSubpathPolygons (self, QMatrix?matrix?=?QMatrix())` * `list-of-QPolygonF toSubpathPolygons (self, QTransform?matrix)` * `translate (self, float?dx, float?dy)` * `translate (self, QPointF?offset)` * `QPainterPath translated (self, float?dx, float?dy)` * `QPainterPath translated (self, QPointF?offset)` * `QPainterPath united (self, QPainterPath?r)` ### Special Methods * `QPainterPath __add__ (self, QPainterPath?other)` * `QPainterPath __and__ (self, QPainterPath?other)` * `bool __eq__ (self, QPainterPath?other)` * `QPainterPath __iadd__ (self, QPainterPath?other)` * `QPainterPath __iand__ (self, QPainterPath?other)` * `QPainterPath __ior__ (self, QPainterPath?other)` * `QPainterPath __isub__ (self, QPainterPath?other)` * `QPainterPath __mul__ (self, QMatrix?m)` * `QPainterPath __mul__ (self, QTransform?m)` * `bool __ne__ (self, QPainterPath?other)` * `QPainterPath __or__ (self, QPainterPath?other)` * `QPainterPath __sub__ (self, QPainterPath?other)` * * * ## Detailed Description 該QPainterPath類提供一個容器,用于繪制操作,從而能夠構造和重用的圖形形狀。 一個畫家路徑是大量的圖形積木,如矩形,橢圓,直線和曲線組成的對象。積木可以在封閉的子路徑被接合,例如為矩形或橢圓形。一個封閉的路徑已重合的起點和終點。或者,他們可以獨立存在的未封閉的子路徑,如直線和曲線。 一個QPainterPath對象可用于填充,概述,和削波。要生成可填寫概括為一個給定的畫家路徑,使用[QPainterPathStroker](qpainterpathstroker.html)類。畫家路徑超過正常的繪圖操作的主要優點是,復雜的形狀只需要創建一次,然后就可以使用繪制多次調用只對[QPainter.drawPath](qpainter.html#drawPath)()函數。 QPainterPath提供了可用于獲得關于路徑和它的元素的信息的功能的集合。此外,可以利用扭轉元素的順序的[toReversed](qpainterpath.html#toReversed)()函數。還有一些功能,這個畫家路徑對象轉換為多邊形表示。 ### Composing a QPainterPath 甲QPainterPath對象可以被構造為一個空的路徑,與給定的起始點,或者作為另一個QPainterPath對象的一個副本。一旦創建,直線和曲線可以使用被添加到路徑的[lineTo](qpainterpath.html#lineTo)( )[arcTo](qpainterpath.html#arcTo)( )[cubicTo](qpainterpath.html#cubicTo)()和[quadTo](qpainterpath.html#quadTo)()函數。在直線和曲線舒展從[currentPosition](qpainterpath.html#currentPosition)()來作為參數傳遞的位置。 該[currentPosition](qpainterpath.html#currentPosition)該QPainterPath對象的( )始終是添加的最后一個子路徑(或初始起點)的結束位置。使用[moveTo](qpainterpath.html#moveTo)( )函數來移動[currentPosition](qpainterpath.html#currentPosition)()無添加的成分。該[moveTo](qpainterpath.html#moveTo)()函數,隱啟動一個新的子路徑,并且關閉前一個。開始一個新的子路徑的另一種方式是調用[closeSubpath](qpainterpath.html#closeSubpath)( )函數,它通過從添加一行關閉當前路徑[currentPosition](qpainterpath.html#currentPosition)( )返回路徑的起始位置。請注意,新的路徑不會有(0,0 ),作為其初始[currentPosition](qpainterpath.html#currentPosition)( ) 。 QPainterPath類還提供了一些方便的功能來封閉的子路徑添加到一個畫家路徑:[addEllipse](qpainterpath.html#addEllipse)( )[addPath](qpainterpath.html#addPath)( )[addRect](qpainterpath.html#addRect)( )[addRegion](qpainterpath.html#addRegion)()和[addText](qpainterpath.html#addText)( ) 。該[addPolygon](qpainterpath.html#addPolygon)( )函數添加_unclosed_子路徑。事實上,這些功能是所有集合[moveTo](qpainterpath.html#moveTo)( )[lineTo](qpainterpath.html#lineTo)()和[cubicTo](qpainterpath.html#cubicTo)( )操作。 此外,一個路徑可以使用被添加到當前路徑[connectPath](qpainterpath.html#connectPath)()函數。但要注意,這個函數將在當前路徑的最后一個元素連接到給定的一個的第一個元素添加一行。 下面是一個代碼片段顯示了如何QPainterPath對象可用于: | ![](https://img.kancloud.cn/e7/b5/e7b5ebcb666bcea64725d2796a8fac5a_100x100.png) | ``` QPainterPath path; path.addRect(20, 20, 60, 60); path.moveTo(0, 0); path.cubicTo(99, 0, 50, 50, 99, 99); path.cubicTo(0, 99, 50, 50, 0, 0); [QPainter](qpainter.html) painter(this); painter.fillRect(0, 0, 100, 100, [Qt](qt.html).white); painter.setPen([QPen](qpen.html)([QColor](qcolor.html)(79, 106, 25), 1, [Qt](qt.html).SolidLine, [Qt](qt.html).FlatCap, [Qt](qt.html).MiterJoin)); painter.setBrush([QColor](qcolor.html)(122, 163, 39)); painter.drawPath(path); ``` | 當構建畫家路徑最初是空的。我們首先添加一個矩形,這是一個封閉的子路徑。然后,我們添加兩個貝茲曲線共同構成,即使他們不是單獨關閉一個封閉的子路徑。最后,我們繪制整個路徑。該路徑是使用默認的填充規則填充,[Qt.OddEvenFill](qt.html#FillRule-enum)。 Qt提供了兩種方法來填充路徑: | [Qt.OddEvenFill](qt.html#FillRule-enum) | [Qt.WindingFill](qt.html#FillRule-enum) | | --- | --- | | ![](https://img.kancloud.cn/cb/54/cb54e06e32ea25c12fdba39c319de1af_230x204.png) | ![](https://img.kancloud.cn/ad/c7/adc72ed5173ee823e438445a2756f050_231x202.png) | 請參閱[Qt.FillRule](qt.html#FillRule-enum)文檔規則的定義。一個畫家路徑的當前設置填充規則可使用檢索到的[fillRule](qpainterpath.html#fillRule)()函數,并使用改變了[setFillRule](qpainterpath.html#setFillRule)()函數。 ### QPainterPath Information 該QPainterPath類提供的功能的集合,它返回的路徑及其元素的信息。 該[currentPosition](qpainterpath.html#currentPosition)( )函數返回已添加的最后一個子路徑(或初始起點)的終點。該[elementAt](qpainterpath.html#elementAt)()函數可以被用于檢索各個子路徑元素,則_number_元素可使用檢索到的[elementCount](qpainterpath.html#elementCount)()函數,并且[isEmpty](qpainterpath.html#isEmpty)( )函數告訴這個QPainterPath對象是否包含在所有的任何元素。 該[controlPointRect](qpainterpath.html#controlPointRect)( )函數返回一個包含此路徑的所有點和控制點的矩形。這個功能是顯著更快的計算比精確[boundingRect](qpainterpath.html#boundingRect)( )返回這個畫家路徑的邊界矩形與浮點精度。 最后, QPainterPath提供[contains](qpainterpath.html#contains)()函數可以被用來確定一個給定的點或矩形是否是路徑內,并且[intersects](qpainterpath.html#intersects)( )函數,它確定是否任何一個給定的矩形內的點也都是這個路徑里。 ### QPainterPath Conversion 由于兼容性的原因,它可能需要簡化畫家路徑的表示: QPainterPath提供[toFillPolygon](qpainterpath.html#toFillPolygon)( )[toFillPolygons](qpainterpath.html#toFillPolygons)()和[toSubpathPolygons](qpainterpath.html#toSubpathPolygons)( )函數的轉換畫家路徑轉換為多邊形。該[toFillPolygon](qpainterpath.html#toFillPolygon)( )返回畫家路徑作為一個單獨的多邊形,而后面兩個函數返回的多邊形列表。 該[toFillPolygons](qpainterpath.html#toFillPolygons)()和[toSubpathPolygons](qpainterpath.html#toSubpathPolygons)提供()函數,因為它通常是更快地繪制幾個小的多邊形,而不是繪制一個大的多邊形,即使點繪制的總數是相同的。兩者之間的區別是_number_多邊形他們返回:該[toSubpathPolygons](qpainterpath.html#toSubpathPolygons)( )創建一個多邊形的每個子路徑,無論相交的子路徑(即重疊邊界矩形) ,而[toFillPolygons](qpainterpath.html#toFillPolygons)( )函數只創建一個重疊的子路徑多邊形。 該[toFillPolygon](qpainterpath.html#toFillPolygon)()和[toFillPolygons](qpainterpath.html#toFillPolygons)( )函數首先將所有的子路徑為多邊形,然后使用倒帶技術,以確保重疊的子路徑可以使用正確的填充規則來填補。注意,倒帶插入附加行中的多邊形,以便填充多邊形的輪廓并不路徑的輪廓相匹配。 ### Examples Qt提供了[Painter Paths Example](index.htm)和[Vector Deformation Demo](index.htm)分別位于Qt的例子和演示目錄分別。 該[Painter Paths Example](index.htm)顯示了畫家的路徑如何可以用來構建復雜的形狀進行渲染,并讓用戶實驗用的填充和描邊。該[Vector Deformation Demo](index.htm)展示了如何使用QPainterPath繪制文本。 | [Painter Paths Example](index.htm) | [Vector Deformation Demo](index.htm) | | --- | --- | | ![](https://img.kancloud.cn/1d/c9/1dc9d8fc0fa85197a2d6abeffba9ec40_229x303.png) | ![](https://img.kancloud.cn/cb/3a/cb3a8e8f8514d6cdc2999662b39c2936_231x304.png) | * * * ## Type Documentation ``` QPainterPath.ElementType ``` 該枚舉描述了用于連接的頂點中的子路徑元素的類型。 需要注意的是元素的加入為封閉的子路徑使用[addEllipse](qpainterpath.html#addEllipse)( )[addPath](qpainterpath.html#addPath)( )[addPolygon](qpainterpath.html#addPolygon)( )[addRect](qpainterpath.html#addRect)( )[addRegion](qpainterpath.html#addRegion)()和[addText](qpainterpath.html#addText)( )的便利功能,采用實際添加到路徑作為單獨的元素的集合[moveTo](qpainterpath.html#moveTo)( )[lineTo](qpainterpath.html#lineTo)()和[cubicTo](qpainterpath.html#cubicTo)()函數。 | Constant | Value | Description | | --- | --- | --- | | `QPainterPath.MoveToElement` | `0` | 一個新的子路徑。另請參閱[moveTo](qpainterpath.html#moveTo)( ) 。 | | `QPainterPath.LineToElement` | `1` | A線。另請參閱[lineTo](qpainterpath.html#lineTo)( ) 。 | | `QPainterPath.CurveToElement` | `2` | 曲線。另請參閱[cubicTo](qpainterpath.html#cubicTo)()和[quadTo](qpainterpath.html#quadTo)( ) 。 | | `QPainterPath.CurveToDataElement` | `3` | 描述曲線在CurveToElement元素所需的額外數據。 | **See also** [elementAt](qpainterpath.html#elementAt)()和[elementCount](qpainterpath.html#elementCount)( ) 。 * * * ## Method Documentation ``` QPainterPath.__init__ (self) ``` 構造一個空[QPainterPath](qpainterpath.html)對象。 ``` QPainterPath.__init__ (self, QPointF?startPoint) ``` 創建[QPainterPath](qpainterpath.html)與給定對象_startPoint_作為它的當前位置。 ``` QPainterPath.__init__ (self, QPainterPath?other) ``` 創建[QPainterPath](qpainterpath.html)對象,它是給定一個副本_path_。 **See also** [operator=](qpainterpath.html#operator-eq)( ) 。 ``` QPainterPath.addEllipse (self, QRectF?rect) ``` 建立內指定的橢圓_boundingRectangle_并把它添加到畫家路徑作為一個封閉的子路徑。 橢圓是由順時針曲線,并開始在零攝氏度整理( 3點鐘位置) 。 | ![](https://img.kancloud.cn/b5/c6/b5c645c824fb38b4764895bb14589493_175x141.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QRectF](qrectf.html) boundingRectangle; [QPainterPath](qpainterpath.html) myPath; myPath.addEllipse(boundingRectangle); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [arcTo](qpainterpath.html#arcTo)( )[QPainter.drawEllipse](qpainter.html#drawEllipse)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addEllipse (self, float?x, float?y, float?w, float?h) ``` 這是一個重載函數。 建立由它左上角的定義矩形邊界內的橢圓形(_x_,_y_) ,_width_和_height_,并將其添加到畫家路徑作為一個封閉的子路徑。 ``` QPainterPath.addEllipse (self, QPointF?center, float?rx, float?ry) ``` 這是一個重載函數。 創建放置在一個橢圓_center_與半徑_rx_和_ry_,并將其添加到畫家路徑作為一個封閉的子路徑。 此功能被引入Qt的4.4 。 ``` QPainterPath.addPath (self, QPainterPath?path) ``` 將給定_path_至_this_路徑作為一個封閉的子路徑。 **See also** [connectPath](qpainterpath.html#connectPath)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addPolygon (self, QPolygonF?polygon) ``` 將給定_polygon_該路徑作為(未關閉)子路徑。 注意,該多邊形后的當前位置已被添加,是在最后一個點_polygon_。畫一條線回到第一點,用[closeSubpath](qpainterpath.html#closeSubpath)()函數。 | ![](https://img.kancloud.cn/db/de/dbdec1c9c5cc13e3eb061bc4d74c639e_259x240.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QPolygonF](qpolygonf.html) myPolygon; [QPainterPath](qpainterpath.html) myPath; myPath.addPolygon(myPolygon); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [lineTo](qpainterpath.html#lineTo)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addRect (self, QRectF?rect) ``` 將給定_rectangle_這條道路是一個封閉的子路徑。 該_rectangle_添加為順時針套系。后畫家路徑的當前位置_rectangle_已經被添加為矩形的左上角。 | ![](https://img.kancloud.cn/92/c4/92c4afa76cca93ad4ab3cce819818e68_179x144.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QRectF](qrectf.html) myRectangle; [QPainterPath](qpainterpath.html) myPath; myPath.addRect(myRectangle); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [addRegion](qpainterpath.html#addRegion)( )[lineTo](qpainterpath.html#lineTo)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addRect (self, float?x, float?y, float?w, float?h) ``` 這是一個重載函數。 添加一個矩形的位置(_x_,_y_) ,使用給定的_width_和_height_作為一個封閉的子路徑。 ``` QPainterPath.addRegion (self, QRegion?region) ``` 將給定_region_通過增加該區域的每個矩形作為一個單獨的封閉的子路徑的路徑。 **See also** [addRect](qpainterpath.html#addRect)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addRoundedRect (self, QRectF?rect, float?xRadius, float?yRadius, Qt.SizeMode?mode?=?Qt.AbsoluteSize) ``` 將指定的矩形_rect_帶圓角的路徑。 該_xRadius_和_yRadius_參數指定限定的圓角矩形的角部的橢圓形的半徑。何時_mode_ is [Qt.RelativeSize](qt.html#SizeMode-enum),_xRadius_和_yRadius_在一半的矩形的寬度和高度的比例分別指定,并應在范圍0.0至100.0 。 此功能被引入Qt的4.4 。 **See also** [addRect](qpainterpath.html#addRect)( ) 。 ``` QPainterPath.addRoundedRect (self, float?x, float?y, float?w, float?h, float?xRadius, float?yRadius, Qt.SizeMode?mode?=?Qt.AbsoluteSize) ``` 這是一個重載函數。 將指定的矩形_x_,_y_,_w_,_h_帶圓角的路徑。 此功能被引入Qt的4.4 。 ``` QPainterPath.addRoundRect (self, QRectF?rect, int?xRnd, int?yRnd) ``` ``` QPainterPath.addRoundRect (self, float?x, float?y, float?w, float?h, int?xRnd, int?yRnd) ``` ``` QPainterPath.addRoundRect (self, QRectF?rect, int?roundness) ``` ``` QPainterPath.addRoundRect (self, float?x, float?y, float?w, float?h, int?roundness) ``` ``` QPainterPath.addText (self, QPointF?point, QFont?f, QString?text) ``` 將給定_text_這個路徑作為一組從已建立封閉的子路徑_font_提供。該子路徑定位,使文本的基線的左端在于在指定的_point_。 | ![](https://img.kancloud.cn/ca/e3/cae351a242c28d444dddd73915a021ae_201x173.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QFont](qfont.html) myFont; [QPointF](qpointf.html) baseline(x, y); [QPainterPath](qpainterpath.html) myPath; myPath.addText(baseline, myFont, tr("Qt")); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [QPainter.drawText](qpainter.html#drawText)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.addText (self, float?x, float?y, QFont?f, QString?text) ``` 這是一個重載函數。 將給定_text_這個路徑作為一組從已建立封閉的子路徑_font_提供。該子路徑定位,使文本的基線的左端處在于通過指定的點(_x_,_y_) 。 ``` float QPainterPath.angleAtPercent (self, float?t) ``` 返回的路徑切線角度的百分比_t_。這個論點_t_必須是0和1之間。 用于角度的正值逆時針意思而負值意味著順時針方向。零度是在3點鐘的位置。 注意,類似于其它百分比的方法,該百分比的測量是不與問候的長度呈線性的曲線,如果是存在于路徑。當曲線存在的比例的參數被映射到噸貝塞爾方程的參數。 ``` QPainterPath.arcMoveTo (self, QRectF?rect, float?angle) ``` 創建一個舉動是在于佔用給定弧_rectangle_在_angle_。 角度單位是度。順時針圓弧可以用負角度被指定。 這個函數中引入了Qt 4.2中。 **See also** [moveTo](qpainterpath.html#moveTo)()和[arcTo](qpainterpath.html#arcTo)( ) 。 ``` QPainterPath.arcMoveTo (self, float?x, float?y, float?w, float?h, float?angle) ``` 這是一個重載函數。 創建一個移動到躺在床上,佔據了弧線[QRectF](qrectf.html)(_x_,_y_,_width_,_height_)在_angle_。 這個函數中引入了Qt 4.2中。 ``` QPainterPath.arcTo (self, QRectF?rect, float?startAngle, float?arcLength) ``` 創建圓弧佔用給定的_rectangle_,開始于指定的_startAngle_并延伸_sweepLength_逆時針旋轉度。 角度單位是度。順時針圓弧可以用負角度被指定。 注意,這個函數圓弧的起點連接到當前的位置,如果它們尚未連接。之后電弧已經被添加,當前位置是在電弧的最后一點。畫一條線回到第一點,用[closeSubpath](qpainterpath.html#closeSubpath)()函數。 | ![](https://img.kancloud.cn/85/98/8598467cdfb6d0f207f51a5479171449_225x177.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QPointF](qpointf.html) center, startPoint; [QPainterPath](qpainterpath.html) myPath; myPath.moveTo(center); myPath.arcTo(boundingRect, startAngle, sweepLength); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [arcMoveTo](qpainterpath.html#arcMoveTo)( )[addEllipse](qpainterpath.html#addEllipse)( )[QPainter.drawArc](qpainter.html#drawArc)( )[QPainter.drawPie](qpainter.html#drawPie)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.arcTo (self, float?x, float?y, float?w, float?h, float?startAngle, float?arcLenght) ``` 這是一個重載函數。 創建圓弧佔據的矩形[QRectF](qrectf.html)(_x_,_y_,_width_,_height_) ,開始于指定的_startAngle_并延伸_sweepLength_逆時針旋轉度。 ``` QRectF QPainterPath.boundingRect (self) ``` [ 返回與浮點精度的矩形這個畫家路徑的邊框。 ](qrectf.html) [**See also**](qrectf.html) [controlPointRect](qpainterpath.html#controlPointRect)( ) 。 ``` QPainterPath.closeSubpath (self) ``` 通過畫線的子路徑的開始,自動啟動一個新的路徑關閉當前子路徑。新路徑的當前點為( 0,0) 。 如果子路徑不包含任何元素,該函數不起作用。 **See also** [moveTo](qpainterpath.html#moveTo)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.connectPath (self, QPainterPath?path) ``` 連接指定的_path_至_this_通過添加從該路徑的最后一個元素的線為給定路徑的第一個元素的路徑。 **See also** [addPath](qpainterpath.html#addPath)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` bool QPainterPath.contains (self, QPointF?pt) ``` 返回True如果給定的_point_是的路徑里面,否則返回False 。 **See also** [intersects](qpainterpath.html#intersects)( ) 。 ``` bool QPainterPath.contains (self, QRectF?rect) ``` 返回True如果給定的_rectangle_是的路徑里面,否則返回False 。 ``` bool QPainterPath.contains (self, QPainterPath?p) ``` 返回True如果給定的路徑_p_包含在當前路徑內。返回False如果當前路徑以及任何邊緣_p_相交。 設置路徑的操作將視路徑,領域。非閉合路徑將被隱式關閉處理。 此功能被引入Qt的4.3 。 **See also** [intersects](qpainterpath.html#intersects)( ) 。 ``` QRectF QPainterPath.controlPointRect (self) ``` [ 返回包含此路徑的所有點和控制點的矩形。 ](qrectf.html) [這個功能是顯著更快的計算比精確](qrectf.html)[boundingRect](qpainterpath.html#boundingRect)() ,并返回的矩形總是返回的矩形的一個超[boundingRect](qpainterpath.html#boundingRect)( ) 。 **See also** [boundingRect](qpainterpath.html#boundingRect)( ) 。 ``` QPainterPath.cubicTo (self, QPointF?ctrlPt1, QPointF?ctrlPt2, QPointF?endPt) ``` 將當前位置與給定之間的三次貝塞爾曲線_endPoint_通過使用指定的控制點_c1_和_c2_。 該曲線被加入后,當前位置被更新為在該曲線的終點。 | ![](https://img.kancloud.cn/cd/f7/cdf7377a524b996a629ae8f6c143c5eb_186x162.png) | ``` [QLinearGradient](qlineargradient.html) myGradient; [QPen](qpen.html) myPen; [QPainterPath](qpainterpath.html) myPath; myPath.cubicTo(c1, c2, endPoint); [QPainter](qpainter.html) painter(this); painter.setBrush(myGradient); painter.setPen(myPen); painter.drawPath(myPath); ``` | **See also** [quadTo](qpainterpath.html#quadTo)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.cubicTo (self, float?ctrlPt1x, float?ctrlPt1y, float?ctrlPt2x, float?ctrlPt2y, float?endPtx, float?endPty) ``` 這是一個重載函數。 將當前位置和結束點之間的三次Bezier曲線(_endPointX_,_endPointY_)與管制站(指定_c1X_,_c1Y_)和(_c2X_,_c2Y_) 。 ``` QPointF QPainterPath.currentPosition (self) ``` [ 返回路徑的當前位置。 ](qpointf.html) ``` Element QPainterPath.elementAt (self, int?i) ``` [ 返回元素在給定的_index_在畫家的路徑。 ](index.htm) [**See also**](index.htm) [ElementType](qpainterpath.html#ElementType-enum),[elementCount](qpainterpath.html#elementCount)()和[isEmpty](qpainterpath.html#isEmpty)( ) 。 ``` int QPainterPath.elementCount (self) ``` 返回在畫家路徑路徑的元素數。 **See also** [ElementType](qpainterpath.html#ElementType-enum),[elementAt](qpainterpath.html#elementAt)()和[isEmpty](qpainterpath.html#isEmpty)( ) 。 ``` Qt.FillRule QPainterPath.fillRule (self) ``` [ 返回畫家路徑的當前設置填充規則。 ](qt.html#FillRule-enum) [**See also**](qt.html#FillRule-enum) [setFillRule](qpainterpath.html#setFillRule)( ) 。 ``` QPainterPath QPainterPath.intersected (self, QPainterPath?r) ``` [ 返回作為此路徑的填充區域的交叉點和路徑_p_的填充區域。貝塞爾曲線可壓扁排隊,由于做貝塞爾曲線交點的數值不穩定段。 此功能被引入Qt的4.3 。 ``` bool QPainterPath.intersects (self, QRectF?rect) ``` 返回True如果在給定的任何一點_rectangle_相交的路徑,否則返回False 。 有一個交叉點,如果任何組成矩形的線條相交的路徑的一部分,或者如果任何部分的矩形的帶路徑包圍的任何區域重疊。這個函數尊重當前fillRule以確定被認為是路徑之內。 ](qpainterpath.html) [**See also**](qpainterpath.html) [contains](qpainterpath.html#contains)( ) 。 ``` bool QPainterPath.intersects (self, QPainterPath?p) ``` 如果當前路徑相交在任何點給定的路徑,則返回True_p_。如果當前路徑包含或被包含的任何部分也返回True_p_。 設置路徑的操作將視路徑,領域。非閉合路徑將被隱式關閉處理。 此功能被引入Qt的4.3 。 **See also** [contains](qpainterpath.html#contains)( ) 。 ``` bool QPainterPath.isEmpty (self) ``` 如果不是有這個路徑沒有任何元素,則返回True,如果只有元素是[MoveToElement](qpainterpath.html#ElementType-enum)否則返回False 。 **See also** [elementCount](qpainterpath.html#elementCount)( ) 。 ``` float QPainterPath.length (self) ``` 返回電流路徑的長度。 ``` QPainterPath.lineTo (self, QPointF?p) ``` 添加一條直線從當前位置到指定_endPoint_。后繪制的線,當前位置被更新為在該行的終點。 **See also** [addPolygon](qpainterpath.html#addPolygon)( )[addRect](qpainterpath.html#addRect)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.lineTo (self, float?x, float?y) ``` 這是一個重載函數。 繪制一條線從當前位置至點(_x_,_y_) 。 ``` QPainterPath.moveTo (self, QPointF?p) ``` 移動當前點到給定_point_,隱式地開始一個新的子路徑和關閉前一個。 **See also** [closeSubpath](qpainterpath.html#closeSubpath)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.moveTo (self, float?x, float?y) ``` 這是一個重載函數。 將當前位置移動到(_x_,_y_),并開始一個新的子路徑,隱含收盤前一路徑。 ``` float QPainterPath.percentAtLength (self, float?t) ``` 返回整個路徑的百分比在規定的長度_len_。 注意,類似于其它百分比的方法,該百分比的測量是不與問候的長度呈線性,如果曲線中存在的路徑。當曲線存在的比例的參數被映射到噸貝塞爾方程的參數。 ``` QPointF QPainterPath.pointAtPercent (self, float?t) ``` [ 返回點的百分比_t_的電流通路的。這個論點_t_必須是0和1之間。 注意,類似于其它百分比的方法,該百分比的測量是不與問候的長度呈線性,如果曲線中存在的路徑。當曲線存在的比例的參數被映射到噸貝塞爾方程的參數。 ``` QPainterPath.quadTo (self, QPointF?ctrlPt, QPointF?endPt) ``` 將當前位置和給定的二次貝塞爾曲線_endPoint_由指定的控制點_c_。 該曲線被加入后,當前點被更新為在該曲線的終點。 ](qpointf.html) [**See also**](qpointf.html) [cubicTo](qpainterpath.html#cubicTo)()和[Composing a QPainterPath](qpainterpath.html#composing-a-qpainterpath)。 ``` QPainterPath.quadTo (self, float?ctrlPtx, float?ctrlPty, float?endPtx, float?endPty) ``` 這是一個重載函數。 將目前的點和終點之間的二次貝塞爾曲線(_endPointX_,_endPointY_)與(指定控制點_cx_,_cy_) 。 ``` QPainterPath.setElementPositionAt (self, int?i, float?x, float?y) ``` 元素的索引設置x和y坐標_index_至_x_和_y_。 這個函數中引入了Qt 4.2中。 ``` QPainterPath.setFillRule (self, Qt.FillRule?fillRule) ``` 設定畫家路徑的填充規則給定的_fillRule_。 Qt提供了兩種方法來填充路徑: | [Qt.OddEvenFill](qt.html#FillRule-enum) (default) | [Qt.WindingFill](qt.html#FillRule-enum) | | --- | --- | | ![](https://img.kancloud.cn/cb/54/cb54e06e32ea25c12fdba39c319de1af_230x204.png) | ![](https://img.kancloud.cn/ad/c7/adc72ed5173ee823e438445a2756f050_231x202.png) | **See also** [fillRule](qpainterpath.html#fillRule)( ) 。 ``` QPainterPath QPainterPath.simplified (self) ``` [](qpainterpath.html) [返回此路徑的簡化版本。這意味著合并相交的所有子路徑,并返回包含任何相交的邊緣的路徑。連續的平行線也將被合并。簡化的路徑將始終使用默認的填充規則,](qpainterpath.html)[Qt.OddEvenFill](qt.html#FillRule-enum)。貝塞爾曲線可壓扁排隊,由于做貝塞爾曲線交點的數值不穩定段。 此功能被引入Qt的4.4 。 ``` float QPainterPath.slopeAtPercent (self, float?t) ``` 返回路徑的斜率的百分比_t_。這個論點_t_必須是0和1之間。 注意,類似于其它百分比的方法,該百分比的測量是不與問候的長度呈線性,如果曲線中存在的路徑。當曲線存在的比例的參數被映射到噸貝塞爾方程的參數。 ``` QPainterPath QPainterPath.subtracted (self, QPainterPath?r) ``` [ 返回這是一個路徑_p_的填充區域由這條路徑的填充區域中減去。 設置路徑的操作將視路徑,領域。非閉合路徑將被隱式關閉處理。貝塞爾曲線可壓扁排隊,由于做貝塞爾曲線交點的數值不穩定段。 此功能被引入Qt的4.3 。 ](qpainterpath.html) ``` QPainterPath QPainterPath.subtractedInverted (self, QPainterPath?r) ``` [ ``` QPainterPath.swap (self, QPainterPath?other) ``` 掉期的畫家路徑_other_這個畫家路徑。這個操作是非常快的,而且永遠不會。 此功能被引入Qt的4.8 。 ](qpainterpath.html) ``` QPolygonF QPainterPath.toFillPolygon (self, QMatrix?matrix?=?QMatrix()) ``` [](qpolygonf.html) [路徑轉換成使用多邊形](qpolygonf.html)[QTransform](qtransform.html) _matrix_,并返回該多邊形。 多邊形是由首先將所有的子路徑為多邊形,然后使用回卷技術,以確保重疊的子路徑可以使用正確的填充規則填充創建。 注意,倒帶插入附加系中的多邊形,以便填充多邊形的輪廓并不路徑的輪廓相匹配。 **See also** [toSubpathPolygons](qpainterpath.html#toSubpathPolygons)( )[toFillPolygons](qpainterpath.html#toFillPolygons)()和[QPainterPath Conversion](qpainterpath.html#qpainterpath-conversion)。 ``` QPolygonF QPainterPath.toFillPolygon (self, QTransform?matrix) ``` [ 這是一個重載函數。 ``` list-of-QPolygonF QPainterPath.toFillPolygons (self, QMatrix?matrix?=?QMatrix()) ``` ](qpolygonf.html) [路徑轉換成多邊形使用列表中的](qpolygonf.html)[QTransform](qtransform.html) _matrix_,并返回該列表。 該功能不同于[toFillPolygon](qpainterpath.html#toFillPolygon)( )函數,它創建幾個多邊形。它被設置,因為它通常更快速地繪制幾個小的多邊形,而不是繪制一個大的多邊形,即使點繪制的總數是相同的。 該toFillPolygons ()函數不同于[toSubpathPolygons](qpainterpath.html#toSubpathPolygons)( )函數,它創建具有重疊邊界矩形子路徑只有多邊形。 像[toFillPolygon](qpainterpath.html#toFillPolygon)( )函數,該函數使用一個收卷技術,以確保重疊的子路徑可以使用正確的填充規則來填補。另外,在多邊形復捲插入附加系,以便填充多邊形的輪廓并不路徑的輪廓相匹配。 **See also** [toSubpathPolygons](qpainterpath.html#toSubpathPolygons)( )[toFillPolygon](qpainterpath.html#toFillPolygon)()和[QPainterPath Conversion](qpainterpath.html#qpainterpath-conversion)。 ``` list-of-QPolygonF QPainterPath.toFillPolygons (self, QTransform?matrix) ``` 這是一個重載函數。 ``` QPainterPath QPainterPath.toReversed (self) ``` [ 創建并返回路徑的逆轉副本。 ](qpainterpath.html) [它是一種顛倒元素的順序:如果](qpainterpath.html)[QPainterPath](qpainterpath.html)通過調用組成的[moveTo](qpainterpath.html#moveTo)( )[lineTo](qpainterpath.html#lineTo)()和[cubicTo](qpainterpath.html#cubicTo)( )按照指定的順序功能,逆轉副本是通過調用組成[cubicTo](qpainterpath.html#cubicTo)( )[lineTo](qpainterpath.html#lineTo)()和[moveTo](qpainterpath.html#moveTo)( ) 。 ``` list-of-QPolygonF QPainterPath.toSubpathPolygons (self, QMatrix?matrix?=?QMatrix()) ``` 路徑轉換成多邊形使用列表中的[QTransform](qtransform.html) _matrix_,并返回該列表。 這個函數創建一個多邊形的每個子路徑,無論相交的子路徑(即重疊邊界矩形)的。為了確保這種重疊的子路徑正確填寫,使用[toFillPolygons](qpainterpath.html#toFillPolygons)( )函數來代替。 **See also** [toFillPolygons](qpainterpath.html#toFillPolygons)( )[toFillPolygon](qpainterpath.html#toFillPolygon)()和[QPainterPath Conversion](qpainterpath.html#qpainterpath-conversion)。 ``` list-of-QPolygonF QPainterPath.toSubpathPolygons (self, QTransform?matrix) ``` 這是一個重載函數。 ``` QPainterPath.translate (self, float?dx, float?dy) ``` 由(轉換路徑中的所有元素_dx_,_dy_) 。 此功能被引入Qt的4.6 。 **See also** [translated](qpainterpath.html#translated)( ) 。 ``` QPainterPath.translate (self, QPointF?offset) ``` 這是一個重載函數。 由給定的轉化路徑中的所有元素_offset_。 此功能被引入Qt的4.6 。 **See also** [translated](qpainterpath.html#translated)( ) 。 ``` QPainterPath QPainterPath.translated (self, float?dx, float?dy) ``` [ 返回由(翻譯路徑的拷貝_dx_,_dy_) 。 此功能被引入Qt的4.6 。 ](qpainterpath.html) [**See also**](qpainterpath.html) [translate](qpainterpath.html#translate)( ) 。 ``` QPainterPath QPainterPath.translated (self, QPointF?offset) ``` [ 這是一個重載函數。 返回一個由給定的原版的路徑的副本_offset_。 此功能被引入Qt的4.6 。 ](qpainterpath.html) [**See also**](qpainterpath.html) [translate](qpainterpath.html#translate)( ) 。 ``` QPainterPath QPainterPath.united (self, QPainterPath?r) ``` [ 返回作為此路徑的填充區域和工會的路徑_p_的填充區域。 設置路徑的操作將視路徑,領域。非閉合路徑將被隱式關閉處理。貝塞爾曲線可壓扁排隊,由于做貝塞爾曲線交點的數值不穩定段。 此功能被引入Qt的4.3 。 ](qpainterpath.html) [**See also**](qpainterpath.html) [intersected](qpainterpath.html#intersected)()和[subtracted](qpainterpath.html#subtracted)( ) 。 ``` QPainterPath QPainterPath.__add__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__and__ (self, QPainterPath?other) ``` [ ``` bool QPainterPath.__eq__ (self, QPainterPath?other) ``` ](qpainterpath.html) ``` QPainterPath QPainterPath.__iadd__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__iand__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__ior__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__isub__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__mul__ (self, QMatrix?m) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__mul__ (self, QTransform?m) ``` [ ``` bool QPainterPath.__ne__ (self, QPainterPath?other) ``` ](qpainterpath.html) ``` QPainterPath QPainterPath.__or__ (self, QPainterPath?other) ``` [](qpainterpath.html) ``` QPainterPath QPainterPath.__sub__ (self, QPainterPath?other) ``` [](qpainterpath.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看