<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QGradient Class Reference ## [[QtGui](index.htm) module] 該QGradient類是用來與組合[QBrush](qbrush.html)指定漸變填充。[More...](#details) 通過繼承[QConicalGradient](qconicalgradient.html),[QLinearGradient](qlineargradient.html)和[QRadialGradient](qradialgradient.html)。 ### Types * `enum CoordinateMode { LogicalMode, StretchToDeviceMode, ObjectBoundingMode }` * `enum Spread { PadSpread, ReflectSpread, RepeatSpread }` * `enum Type { LinearGradient, RadialGradient, ConicalGradient, NoGradient }` ### Methods * `__init__ (self)` * `__init__ (self, QGradient)` * `CoordinateMode coordinateMode (self)` * `setColorAt (self, float?pos, QColor?color)` * `setCoordinateMode (self, CoordinateMode?mode)` * `setSpread (self, Spread?aspread)` * `setStops (self, list-of-tuple-of-float-QColor?stops)` * `Spread spread (self)` * `list-of-tuple-of-float-QColor stops (self)` * `Type type (self)` ### Special Methods * `bool __eq__ (self, QGradient?gradient)` * `bool __ne__ (self, QGradient?other)` * * * ## Detailed Description 該QGradient類是用來與組合[QBrush](qbrush.html)指定漸變填充。 目前的Qt支持三種類型的漸變填充的: * _Linear_ gradients interpolate colors between start and end points. * _Simple_ radial gradients interpolate colors between a focal point and end points on a circle surrounding it. * _Extended_ radial gradients interpolate colors between a center and a focal circle. * _Conical_ gradients interpolate colors around a center point. 漸變的類型可以使用被檢索[type](qgradient.html#type)()函數。每個類型的被QGradient的子類表示: | [QLinearGradient](qlineargradient.html) | [QRadialGradient](qradialgradient.html) | [QConicalGradient](qconicalgradient.html) | | --- | --- | --- | | ![](https://img.kancloud.cn/93/56/9356eb67913b4a5349d737cb2df63f74_140x128.png) | ![](https://img.kancloud.cn/c4/19/c41967352375f76af44ae2bb77a7d7f8_140x127.png) | ![](https://img.kancloud.cn/cd/31/cd31f8eec37e9635580ff45fa6dc2bed_140x128.png) | 在漸變中的顏色所使用的停止點定義[QGradientStop](qgradient.html#QGradientStop-typedef)型,即,位置和顏色。使用[setColorAt](qgradient.html#setColorAt)( )函數來定義一個停止點。或者,使用[setStops](qgradient.html#setStops)( )函數來一氣呵成定義幾個止損點。需要注意的是,后者的功能_replaces_當前設定的止損點。 它是漸變的一整套停止點(可通過[stops](qgradient.html#stops)( )函數) ,描述如何漸變區域應填補。如果已指定沒有停止點,黑色在0到白在1梯度使用。 從黑對角線線性梯度( 100 , 100) ,以白色為( 200 , 200 )可以這樣指定: ``` [QLinearGradient](qlineargradient.html) linearGrad([QPointF](qpointf.html)(100, 100), [QPointF](qpointf.html)(200, 200)); linearGrad.setColorAt(0, [Qt](qt.html).black); linearGrad.setColorAt(1, [Qt](qt.html).white); ``` 漸變可以有止損點的一個任意數字。下面將創建開始,紅色在中心,藍色和綠色,然后在邊緣的徑向漸變: ``` [QRadialGradient](qradialgradient.html) radialGrad([QPointF](qpointf.html)(100, 100), 100); radialGrad.setColorAt(0, [Qt](qt.html).red); radialGrad.setColorAt(0.5, [Qt](qt.html).blue); radialGrad.setColorAt(1, [Qt](qt.html).green); ``` 它可以借由指定其區域之外的重復或反映該梯度的[spread method](qgradient.html#Spread-enum)使用[setSpread](qgradient.html#setSpread)()函數。缺省值是墊在最近停止點的顏色外區域。當前設置[spread method](qgradient.html#Spread-enum)可使用檢索到的[spread](qgradient.html#spread)()函數。該[QGradient.Spread](qgradient.html#Spread-enum)枚舉定義了三種不同的方法: | ![](https://img.kancloud.cn/fd/90/fd90ea529ad15a0532497d923b447127_219x294.png) | ![](https://img.kancloud.cn/9f/06/9f065e6be32c6d978f25dbfd7ab6c8bf_220x296.png) | ![](https://img.kancloud.cn/ef/1c/ef1c6108e3d9594ed04e84a5f0757768_220x296.png) | | [PadSpread](qgradient.html#Spread-enum) | [RepeatSpread](qgradient.html#Spread-enum) | [ReflectSpread](qgradient.html#Spread-enum) | 注意,這個[setSpread](qgradient.html#setSpread)()函數只具有線性和徑向漸變效果。其原因是,在錐形梯度通過定義封閉的,即_conical_漸變填充從0整個圓 - 360度,而徑向或線性梯度的邊界可以通過它的半徑或最終停止點,分別被指定。 梯度坐標可以在邏輯坐標,相對于設備坐標,或者相對于對象的邊界框的坐標來指定。該[coordinate mode](qgradient.html#CoordinateMode-enum)可使用設置[setCoordinateMode](qgradient.html#setCoordinateMode)()函數。默認值是[LogicalMode](qgradient.html#CoordinateMode-enum),其中所述梯度的坐標以相同的方式作為對象坐標指定。要檢索當前設置的[coordinate mode](qgradient.html#CoordinateMode-enum)使用[coordinateMode](qgradient.html#coordinateMode)( ) 。 * * * ## Type Documentation ``` QGradient.CoordinateMode ``` 此枚舉指定如何漸變的坐標映射到其上的梯度可用于油漆設備。 | Constant | Value | Description | | --- | --- | --- | | `QGradient.LogicalMode` | `0` | 這是默認模式。漸變坐標指定的邏輯空間只是該對象的坐標等。 | | `QGradient.StretchToDeviceMode` | `1` | 在這種模式下,漸變的坐標是相對于漆設備的邊界矩形,與( 0,0 )在左上角,(1,1 )中的繪圖設備的右下角。 | | `QGradient.ObjectBoundingMode` | `2` | 在這種模式下,梯度坐標是相對于被繪制的對象,用( 0,0 )在左上角,(1,1 ),在對象的邊界矩形的右下角的邊框。 | 這個枚舉被引入或修改的Qt 4.4 。 ``` QGradient.Spread ``` 指定如何梯度范圍之外的區域應該充滿。 | Constant | Value | Description | | --- | --- | --- | | `QGradient.PadSpread` | `0` | 該地區充滿了最近的車站顏色。這是默認的。 | | `QGradient.RepeatSpread` | `2` | 梯度是重復的梯度區域之外。 | | `QGradient.ReflectSpread` | `1` | 該梯度的梯度范圍之外的反映。 | **See also** [spread](qgradient.html#spread)()和[setSpread](qgradient.html#setSpread)( ) 。 ``` QGradient.Type ``` 指定漸變的類型。 | Constant | Value | Description | | --- | --- | --- | | `QGradient.LinearGradient` | `0` | 開始和結束點之間進行內插的色彩([QLinearGradient](qlineargradient.html)) 。 | | `QGradient.RadialGradient` | `1` | 插色焦點之間和結束它周圍一圈點([QRadialGradient](qradialgradient.html)) 。 | | `QGradient.ConicalGradient` | `2` | 插圍繞中心點的顏色([QConicalGradient](qconicalgradient.html)) 。 | | `QGradient.NoGradient` | `3` | 無梯度被使用。 | **See also** [type](qgradient.html#type)( ) 。 * * * ## Method Documentation ``` QGradient.__init__ (self) ``` ``` QGradient.__init__ (self, QGradient) ``` ``` CoordinateMode QGradient.coordinateMode (self) ``` [](qgradient.html#CoordinateMode-enum) [返回此漸變的坐標模式。默認模式是](qgradient.html#CoordinateMode-enum)[LogicalMode](qgradient.html#CoordinateMode-enum)。 此功能被引入Qt的4.4 。 **See also** [setCoordinateMode](qgradient.html#setCoordinateMode)( ) 。 ``` QGradient.setColorAt (self, float?pos, QColor?color) ``` 創建一個停止點在給定的_position_用給定的_color_。給定_position_必須是范圍為0到1。 **See also** [setStops](qgradient.html#setStops)()和[stops](qgradient.html#stops)( ) 。 ``` QGradient.setCoordinateMode (self, CoordinateMode?mode) ``` 這個漸變的坐標模式設置為_mode_。默認模式是[LogicalMode](qgradient.html#CoordinateMode-enum)。 此功能被引入Qt的4.4 。 **See also** [coordinateMode](qgradient.html#coordinateMode)( ) 。 ``` QGradient.setSpread (self, Spread?aspread) ``` 指定的蔓延_method_應該用于該梯度。 注意,該函數只具有線性和徑向漸變效果。 **See also** [spread](qgradient.html#spread)( ) 。 ``` QGradient.setStops (self, list-of-tuple-of-float-QColor?stops) ``` 替換當前設置的止損點與給定_stopPoints_。該點的位置必須在0到1范圍,并與最低點首先必須進行排序。 **See also** [setColorAt](qgradient.html#setColorAt)()和[stops](qgradient.html#stops)( ) 。 ``` Spread QGradient.spread (self) ``` [](qgradient.html#Spread-enum) [返回此梯度擴散方法的使用。默認值是](qgradient.html#Spread-enum)[PadSpread](qgradient.html#Spread-enum)。 **See also** [setSpread](qgradient.html#setSpread)( ) 。 ``` list-of-tuple-of-float-QColor QGradient.stops (self) ``` 返回止損點,這個梯度。 如果已指定沒有停止點,黑色在0到白在1梯度使用。 **See also** [setStops](qgradient.html#setStops)()和[setColorAt](qgradient.html#setColorAt)( ) 。 ``` Type QGradient.type (self) ``` [ 返回漸變的類型。 ``` bool QGradient.__eq__ (self, QGradient?gradient) ``` ``` bool QGradient.__ne__ (self, QGradient?other) ``` ](qgradient.html#Type-enum)
                  <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>

                              哎呀哎呀视频在线观看