Class: QgsColorTextWidget

A line edit widget which displays colors as text and accepts string representations of colors.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsColorTextWidget

Base classes

QgsColorWidget

A base class for interactive color widgets. Widgets can either allow setting a single component of a color (e.g., the red or green components), or an entire color. The QgsColorWidget also keeps track of any explicitly set hue for the color, so that this information is not lost when the widget is set to a color with an ambiguous hue (e.g., black or white shades).

QWidget

QObject

QPaintDevice

Methods

setAllowOpacity

Sets whether opacity modification (transparency) is permitted.

Attributes

HexRgb

HexRgbA

Rgb

Rgba

class qgis.gui.QgsColorTextWidget[source]

Bases: QgsColorWidget

__init__(parent: QWidget | None = None)

Construct a new color line edit widget.

Parameters:

parent (Optional[QWidget] = None) – parent QWidget for the widget

class ColorTextFormat

Bases: int

HexRgb = 0
HexRgbA = 1
Rgb = 2
Rgba = 3
setAllowOpacity(self, allowOpacity: bool)[source]

Sets whether opacity modification (transparency) is permitted. Defaults to True.

Parameters:

allowOpacity (bool) – set to False to disable opacity modification