Skip to main content

ColorAlphaControls

ColorAlphaControls

Compact color + alpha editing widget. More…

#include <ColorAlphaControls.hpp>

Inherits from QWidget

Public Signals

Name
void colorChanged(QString const & hex_color)
Emitted when the user picks a new color.
void alphaChanged(float alpha)
Emitted when the user changes the alpha value.

Public Functions

Name
ColorAlphaControls(QWidget * parent =[nullptr])
Construct color/alpha controls.
~ColorAlphaControls() override =default
void setColor(QString const & hex_color)
Set the current color.
void setAlpha(float alpha)
Set the current alpha.
QString hexColor() const
Get the current hex color.
float alpha() const
Get the current alpha.
QPushButton * colorButton() const
Get the color button (for external layout tweaks).
QDoubleSpinBox * alphaSpinBox() const
Get the alpha spin box (for external layout tweaks).

Detailed Description

class ColorAlphaControls;

Compact color + alpha editing widget.

Provides a colored QPushButton that opens QColorDialog and a QDoubleSpinBox for alpha (0.0 – 1.0).

Public Signals Documentation

signal colorChanged

void colorChanged(
    QString const & hex_color
)

Emitted when the user picks a new color.

Parameters:

  • hex_color The new hex color string

signal alphaChanged

void alphaChanged(
    float alpha
)

Emitted when the user changes the alpha value.

Parameters:

  • alpha The new alpha in [0.0, 1.0]

Public Functions Documentation

function ColorAlphaControls

explicit ColorAlphaControls(
    QWidget * parent =nullptr
)

Construct color/alpha controls.

Parameters:

  • parent Parent widget

function ~ColorAlphaControls

~ColorAlphaControls() override =default

function setColor

void setColor(
    QString const & hex_color
)

Set the current color.

Parameters:

  • hex_color Hex color string (e.g. “#FF0000”)

function setAlpha

void setAlpha(
    float alpha
)

Set the current alpha.

Parameters:

  • alpha Alpha value in [0.0, 1.0]

function hexColor

QString hexColor() const

Get the current hex color.

function alpha

float alpha() const

Get the current alpha.

function colorButton

inline QPushButton * colorButton() const

Get the color button (for external layout tweaks).

function alphaSpinBox

inline QDoubleSpinBox * alphaSpinBox() const

Get the alpha spin box (for external layout tweaks).


Updated on 2026-11-13 at 20:25:41 +0000