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.

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