Class: QgsColorRampWidget¶
-
class
qgis.gui.
QgsColorRampWidget
(parent: QWidget = None, component: QgsColorWidget.ColorComponent = QgsColorWidget.Red, orientation: QgsColorRampWidget.Orientation = QgsColorRampWidget.Horizontal)¶ Bases:
QgsColorWidget
Construct a new color ramp widget.
- Parameters
parent (QWidget = None) – parent QWidget for the widget
component (QgsColorWidget.ColorComponent = QgsColorWidget.Red) – color component which varies along the ramp
orientation (QgsColorRampWidget.Orientation = QgsColorRampWidget.Horizontal) – orientation for widget
A color ramp widget. This widget consists of an interactive box filled with a color which varies along its length by a single color component (e.g., varying saturation from 0 to 100%).
Methods
Fetches the margin between the edge of the widget and the ramp
- param event
- param event
- param event
Fetches the orientation for the color ramp
- param event
Sets the margin between the edge of the widget and the ramp
Sets the size for drawing the triangular markers on the ramp
Sets the orientation for the color ramp
Sets whether the ramp should be drawn within a frame
Fetches whether the ramp is drawn within a frame
- rtype
QSize
- param event
Signals
Emitted when the widget’s color component value changes
Attributes
-
Horizontal
= 0¶
-
class
Orientation
¶ Bases:
int
-
Vertical
= 1¶
-
actionEvent
()¶
-
alterColor
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
componentRange
()¶
-
componentValue
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
hue
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
interiorMargin
(self) → int¶ Fetches the margin between the edge of the widget and the ramp
- Return type
int
- Returns
margin around the ramp
See also
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶ - Parameters
event (QKeyEvent) –
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
(self, event: QMouseEvent)¶ - Parameters
event (QMouseEvent) –
-
mousePressEvent
(self, event: QMouseEvent)¶ - Parameters
event (QMouseEvent) –
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
orientation
(self) → QgsColorRampWidget.Orientation¶ Fetches the orientation for the color ramp
- Return type
- Returns
orientation for the ramp
See also
-
paintEvent
(self, event: QPaintEvent)¶ - Parameters
event (QPaintEvent) –
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setInteriorMargin
(self, margin: int)¶ Sets the margin between the edge of the widget and the ramp
- Parameters
margin (int) – margin around the ramp
See also
-
setMarkerSize
(self, markerSize: int)¶ Sets the size for drawing the triangular markers on the ramp
- Parameters
markerSize (int) – marker size in pixels
-
setOrientation
(self, orientation: QgsColorRampWidget.Orientation)¶ Sets the orientation for the color ramp
- Parameters
orientation (QgsColorRampWidget.Orientation) – new orientation for the ramp
See also
-
setShowFrame
(self, showFrame: bool)¶ Sets whether the ramp should be drawn within a frame
- Parameters
showFrame (bool) – set to true to draw a frame around the ramp
See also
-
showEvent
()¶
-
showFrame
(self) → bool¶ Fetches whether the ramp is drawn within a frame
- Return type
bool
- Returns
true if a frame is drawn around the ramp
See also
-
sizeHint
(self) → QSize¶ - Return type
QSize
-
tabletEvent
()¶
-
timerEvent
()¶
-
transparentBackground
()¶
-
updateMicroFocus
()¶
-
valueChanged
¶ Emitted when the widget’s color component value changes
- Parameters
value – new value of color component [signal]
-
wheelEvent
(self, event: QWheelEvent)¶ - Parameters
event (QWheelEvent) –