Class: QgsGradientFillSymbolLayer¶
-
class
qgis.core.
QgsGradientFillSymbolLayer
(color: Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLEFILL_COLOR, color2: Union[QColor, Qt.GlobalColor] = Qt.white, gradientColorType: QgsGradientFillSymbolLayer.GradientColorType = QgsGradientFillSymbolLayer.SimpleTwoColor, gradientType: QgsGradientFillSymbolLayer.GradientType = QgsGradientFillSymbolLayer.Linear, coordinateMode: QgsGradientFillSymbolLayer.GradientCoordinateMode = QgsGradientFillSymbolLayer.Feature, gradientSpread: QgsGradientFillSymbolLayer.GradientSpread = QgsGradientFillSymbolLayer.Pad)¶ Bases:
qgis._core.QgsFillSymbolLayer
QgsGradientFillSymbolLayer(QgsGradientFillSymbolLayer)
Enums
Methods
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor
Returns the color ramp used for the gradient fill.
Coordinate mode for gradient.
Gradient color mode, controls how gradient color stops are created
Gradient spread mode.
Type of gradient, e.g., linear or radial
Sets the color ramp used for the gradient fill.
Offset for gradient fill
Units for gradient fill offset
Starting point of gradient fill, in the range [0,0] - [1,1]
Sets the starting point of the gradient to be the feature centroid
End point of gradient fill, in the range [0,0] - [1,1]
Sets the end point of the gradient to be the feature centroid
Signals
Attributes
-
ColorRamp
= 1¶
-
Conical
= 2¶
-
Feature
= 0¶
-
class
GradientColorType
¶ Bases:
int
-
class
GradientCoordinateMode
¶ Bases:
int
-
class
GradientSpread
¶ Bases:
int
-
class
GradientType
¶ Bases:
int
-
Linear
= 0¶
-
Pad
= 0¶
-
Radial
= 1¶
-
Reflect
= 1¶
-
Repeat
= 2¶
-
SimpleTwoColor
= 0¶
-
Viewport
= 1¶
-
clone
(self) → QgsGradientFillSymbolLayer¶
-
color2
(self) → QColor¶ Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor
-
colorRamp
(self) → QgsColorRamp¶ Returns the color ramp used for the gradient fill. This is only used if the gradient color type is set to ColorRamp.
See also
See also
-
coordinateMode
(self) → QgsGradientFillSymbolLayer.GradientCoordinateMode¶ Coordinate mode for gradient. Controls how the gradient stops are positioned.
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶
-
estimateMaxBleed
(self, context: QgsRenderContext) → float¶
-
gradientColorType
(self) → QgsGradientFillSymbolLayer.GradientColorType¶ Gradient color mode, controls how gradient color stops are created
-
gradientSpread
(self) → QgsGradientFillSymbolLayer.GradientSpread¶ Gradient spread mode. Controls how the gradient behaves outside of the predefined stops
-
gradientType
(self) → QgsGradientFillSymbolLayer.GradientType¶ Type of gradient, e.g., linear or radial
-
layerType
(self) → str¶
-
mapUnitScale
(self) → QgsMapUnitScale¶
-
offset
(self) → QPointF¶
-
offsetMapUnitScale
(self) → QgsMapUnitScale¶
-
offsetUnit
(self) → QgsUnitTypes.RenderUnit¶
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶
-
properties
(self) → Dict[str, str]¶
-
referencePoint1
(self) → QPointF¶
-
referencePoint1IsCentroid
(self) → bool¶
-
referencePoint2
(self) → QPointF¶
-
referencePoint2IsCentroid
(self) → bool¶
-
renderPolygon
(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶
-
restoreOldDataDefinedProperties
()¶
-
setColor2
(self, color2: Union[QColor, Qt.GlobalColor])¶
-
setColorRamp
(self, ramp: QgsColorRamp)¶ Sets the color ramp used for the gradient fill. This is only used if the gradient color type is set to ColorRamp.
- Parameters
ramp – color ramp. Ownership is transferred.
See also
See also
-
setCoordinateMode
(self, coordinateMode: QgsGradientFillSymbolLayer.GradientCoordinateMode)¶
-
setGradientColorType
(self, gradientColorType: QgsGradientFillSymbolLayer.GradientColorType)¶
-
setGradientSpread
(self, gradientSpread: QgsGradientFillSymbolLayer.GradientSpread)¶
-
setGradientType
(self, gradientType: QgsGradientFillSymbolLayer.GradientType)¶
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOffset
(self, offset: Union[QPointF, QPoint])¶ Offset for gradient fill
-
setOffsetMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOffsetUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Units for gradient fill offset
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶
-
setReferencePoint1
(self, referencePoint: Union[QPointF, QPoint])¶ Starting point of gradient fill, in the range [0,0] - [1,1]
-
setReferencePoint1IsCentroid
(self, isCentroid: bool)¶ Sets the starting point of the gradient to be the feature centroid
-
setReferencePoint2
(self, referencePoint: Union[QPointF, QPoint])¶ End point of gradient fill, in the range [0,0] - [1,1]
-
setReferencePoint2IsCentroid
(self, isCentroid: bool)¶ Sets the end point of the gradient to be the feature centroid
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
stopRender
(self, context: QgsSymbolRenderContext)¶
-