Class: QgsColorSliderWidget¶
- class qgis.gui.QgsColorSliderWidget¶
Bases:
QgsColorWidget
A composite horizontal color ramp widget and associated spinbox for manual value entry.
QgsColorSliderWidget(parent: Optional[QWidget] = None, component: QgsColorWidget.ColorComponent = QgsColorWidget.Red) Construct a new color slider widget.
- Parameters:
parent – parent QWidget for the widget
component –
color component which is controlled by the slider
Methods
Alters a color by modifying the value of a specific color component
Returns color widget type of color, either RGB, HSV, CMYK, or Invalid if this component value is Multiple or Alpha
Returns the range of valid values for the color widget's component
Returns the current value of the widget's color component
Returns the hue for the widget.
- param color:
- param component:
- param value:
Generates a checkboard pattern pixmap for use as a background to transparent colors
- actionEvent(self, a0: QActionEvent | None)¶
- alterColor(color: QColor | Qt.GlobalColor, component: QgsColorWidget.ColorComponent, newValue: int)¶
Alters a color by modifying the value of a specific color component
- Parameters:
color – color to alter
component – color component to alter
newValue – new value of color component. Values are automatically clipped to a valid range for the color component.
- changeEvent(self, a0: QEvent | None)¶
- childEvent(self, a0: QChildEvent | None)¶
- closeEvent(self, a0: QCloseEvent | None)¶
- colorSpec(self) QColor.Spec ¶
Returns color widget type of color, either RGB, HSV, CMYK, or Invalid if this component value is Multiple or Alpha
colorSpec(component: QgsColorWidget.ColorComponent) -> QColor.Spec Returns
component
type of color, either RGB, HSV, CMYK, or Invalid ifcomponent
value is Multiple or Alpha
- componentRange(self) int ¶
Returns the range of valid values for the color widget’s component
- Returns:
maximum value allowed for color component, or -1 if widget has multiple components
componentRange(component: QgsColorWidget.ColorComponent) -> int Returns the range of valid values a color component
- Returns:
maximum value allowed for color component
- componentValue(self) int ¶
Returns the current value of the widget’s color component
- Returns:
value of color component, or -1 if widget has multiple components or an invalid color set
See also
See also
component()
componentValue(self, component: QgsColorWidget.ColorComponent) -> int Returns the value of a component of the widget’s current color. This method correctly handles hue values when the color has an ambiguous hue (e.g., black or white shades)
- Parameters:
component – color component to return
- Returns:
value of color component, or -1 if widget has an invalid color set
See also
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, a0: QContextMenuEvent | None)¶
- create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, a0: QEvent | None)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, e: QDragEnterEvent | None)¶
- dragLeaveEvent(self, a0: QDragLeaveEvent | None)¶
- dragMoveEvent(self, a0: QDragMoveEvent | None)¶
- dropEvent(self, e: QDropEvent | None)¶
- enterEvent(self, a0: QEvent | None)¶
- event(self, a0: QEvent | None) bool ¶
- focusInEvent(self, a0: QFocusEvent | None)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, next: bool) bool ¶
- focusOutEvent(self, a0: QFocusEvent | None)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, a0: QHideEvent | None)¶
- hue(self) int ¶
Returns the hue for the widget. This may differ from the hue for the QColor returned by
color()
, as QColor returns a hue of -1 if the color’s hue is ambiguous (e.g., if the saturation is zero).- Returns:
explicitly set hue for widget
- initPainter(self, painter: QPainter | None)¶
- inputMethodEvent(self, a0: QInputMethodEvent | None)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- keyPressEvent(self, a0: QKeyEvent | None)¶
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, a0: QMouseEvent | None)¶
- mouseMoveEvent(self, e: QMouseEvent | None)¶
- mousePressEvent(self, e: QMouseEvent | None)¶
- mouseReleaseEvent(self, e: QMouseEvent | None)¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, a0: QPaintEvent | None)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resizeEvent(self, a0: QResizeEvent | None)¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setColor(self, color: QColor | Qt.GlobalColor, emitSignals: bool = False)¶
- Parameters:
color (Union[QColor)
emitSignals (bool = False)
- setComponent(self, component: QgsColorWidget.ColorComponent)¶
- Parameters:
component (QgsColorWidget.ColorComponent)
- setComponentValue(self, value: int)¶
- Parameters:
value (int)
- showEvent(self, a0: QShowEvent | None)¶
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, a0: QTimerEvent | None)¶
- transparentBackground() QPixmap ¶
Generates a checkboard pattern pixmap for use as a background to transparent colors
- Returns:
checkerboard pixmap
- updateMicroFocus(self)¶
- wheelEvent(self, a0: QWheelEvent | None)¶