Skip to main content

QCustomColorPicker

QCustomColorPicker

A colour selector.

A colour swatch + hex field. Clicking the swatch opens a popup of preset swatches with a "Custom..." button (QColorDialog). Emits colorChanged.

At a glance​

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomColorPicker import QCustomColorPicker
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomColorPicker import QCustomColorPicker

widget = QCustomColorPicker()

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomColorPicker in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
currentColorcolor—

Signals​

Signal
colorChanged(QColor)

Methods​

MethodDescription
color()Color.
colorChanged(...)Color changed.
colorName()Color name.
currentColor(*args, **kwargs)Current color.
setColor(color)Set the color.

Theming​

Colours come from the design tokens, so they follow the active theme. Roles used: focus-ring, on-surface, outline, surface, surface-muted.

See Design tokens.

QCustomButtonGroup · QCustomCheckBox · QCustomComboBox · QCustomDateEdit · QCustomDateRangeEdit · QCustomDateRangePicker · QCustomEmojiPicker · QCustomFileDropZone