Class: QgsCompoundColorWidget

class qgis.gui.QgsCompoundColorWidget(parent: QWidget = None, color: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), layout: QgsCompoundColorWidget.Layout = QgsCompoundColorWidget.LayoutDefault)

Bases: QgsPanelWidget

Constructor for QgsCompoundColorWidget

Parameters
  • parent (QWidget = None) – parent widget

  • color (Union[QColor) – initial color for dialog

  • layout (QgsCompoundColorWidget.Layout = QgsCompoundColorWidget.LayoutDefault) – widget layout to use

A custom QGIS widget for selecting a color, including options for selecting colors via hue wheel, color swatches, and a color sampler.

Methods

actionEvent

changeEvent

childEvent

closeEvent

color

Returns the current color for the dialog

connectNotify

contextMenuEvent

create

createNewUserPalette

Triggers a user prompt for creating a new user color scheme.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

importUserPaletteFromFile

Triggers a user prompt for importing a new color scheme from an existing GPL file.

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

param e

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

param e

mousePressEvent

param e

mouseReleaseEvent

param e

moveEvent

nativeEvent

paintEvent

receivers

removeUserPalette

Triggers a user prompt for removing an existing user color scheme.

resizeEvent

sender

senderSignalIndex

setAllowOpacity

Sets whether opacity modification (transparency) is permitted for the color dialog.

setColor

Sets the current color for the dialog

setDiscarded

Sets whether the widget’s color has been “discarded” and the selected color should not be stored in the recent color list.

setPreviousColor

Sets the color to show in an optional “previous color” section

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

currentColorChanged

Emitted when the dialog’s color changes

Attributes

LayoutDefault

LayoutVertical

class Layout

Bases: int

LayoutDefault = 0
LayoutVertical = 1
actionEvent()
changeEvent()
childEvent()
closeEvent()
color(self) → QColor

Returns the current color for the dialog

Return type

QColor

Returns

dialog color

connectNotify()
contextMenuEvent()
create()
createNewUserPalette(parent: QWidget) → QgsUserColorScheme

Triggers a user prompt for creating a new user color scheme.

The parent argument must be set to a valid parent widget for the dialog prompts.

New in version 3.2.

Parameters

parent (QWidget) –

Return type

QgsUserColorScheme

currentColorChanged

Emitted when the dialog’s color changes

Parameters

color (Union[QColor) – current color [signal]

customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
importUserPaletteFromFile(parent: QWidget) → QgsUserColorScheme

Triggers a user prompt for importing a new color scheme from an existing GPL file.

The parent argument must be set to a valid parent widget for the dialog prompts.

New in version 3.2.

Parameters

parent (QWidget) –

Return type

QgsUserColorScheme

initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent(self, e: QKeyEvent)
Parameters

e (QKeyEvent) –

keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

mousePressEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

mouseReleaseEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

moveEvent()
nativeEvent()
paintEvent()
receivers()
removeUserPalette(scheme: QgsUserColorScheme, parent: QWidget) → bool

Triggers a user prompt for removing an existing user color scheme.

The parent argument must be set to a valid parent widget for the dialog prompts.

New in version 3.2.

Parameters
Return type

bool

resizeEvent()
sender()
senderSignalIndex()
setAllowOpacity(self, allowOpacity: bool)

Sets whether opacity modification (transparency) is permitted for the color dialog. Defaults to True.

Parameters

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

New in version 3.0.

setColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the current color for the dialog

Parameters

color (Union[QColor) – desired color

setDiscarded(self, discarded: bool)

Sets whether the widget’s color has been “discarded” and the selected color should not be stored in the recent color list.

Parameters

discarded (bool) – set to True to avoid adding color to recent color list on widget destruction.

New in version 3.0.

setPreviousColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the color to show in an optional “previous color” section

Parameters

color (Union[QColor) – previous color

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()