Class: QgsColorRampWidget¶
-
class
qgis.gui.
QgsColorRampWidget
(parent: QWidget = None, component: QgsColorWidget.ColorComponent = QgsColorWidget.Red, orientation: QgsColorRampWidget.Orientation = QgsColorRampWidget.Horizontal)¶ Bases:
qgis._gui.QgsColorWidget
Construct a new color ramp widget.
- Parameters
parent – parent QWidget for the widget
component – color component which varies along the ramp
orientation – 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%).
New in version 2.5: Enums
Methods
Fetches the margin between the edge of the widget and the ramp
Fetches the orientation for the color ramp
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
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
- Returns
margin around the ramp
See also
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
(self, event: QMouseEvent)¶
-
mousePressEvent
(self, event: QMouseEvent)¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
orientation
(self) → QgsColorRampWidget.Orientation¶ Fetches the orientation for the color ramp
- Returns
orientation for the ramp
See also
-
paintEvent
(self, event: QPaintEvent)¶
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setInteriorMargin
(self, margin: int)¶ Sets the margin between the edge of the widget and the ramp
- Parameters
margin – margin around the ramp
See also
-
setMarkerSize
(self, markerSize: int)¶ Sets the size for drawing the triangular markers on the ramp
- Parameters
markerSize – marker size in pixels
-
setOrientation
(self, orientation: QgsColorRampWidget.Orientation)¶ Sets the orientation for the color ramp
- Parameters
orientation – new orientation for the ramp
See also
-
setShowFrame
(self, showFrame: bool)¶ Sets whether the ramp should be drawn within a frame
- Parameters
showFrame – 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
- Returns
true if a frame is drawn around the ramp
See also
-
sizeHint
(self) → 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)¶