NDEVR
API Documentation
QCustomColorDialog

A dialog devoted to allowing the user to select a custom color. More...

Public Member Functions

 QCustomColorDialog (bool is_small, bool show_line_edit_pickers, QWidget *parent=nullptr)
 Constructs a QCustomColorDialog with size and line edit picker options.
 QCustomColorDialog (const RGBColor &initial, QWidget *parent=nullptr)
 Constructs a QCustomColorDialog with an initial color and the given parent widget.
 QCustomColorDialog (QWidget *parent=nullptr)
 Constructs a QCustomColorDialog with the given parent widget.
 ~QCustomColorDialog ()
 Destroys the color dialog.
void colorSelected (const RGBColor &color)
 Emitted when a color is selected (confirmed) by the user.
RGBColor currentColor () const
 Returns the color currently being edited in the dialog.
void currentColorEdited (const RGBColor &color)
 Emitted when the current color is changed by the user during editing.
void finishedSignal ()
 Emitted when the dialog is finished (accepted or rejected).
void open (QObject *receiver, const char *member)
 Opens the dialog and connects its finished signal to the specified receiver and member slot.
RGBColor selectedColor () const
 Returns the color that was last selected (confirmed) by the user.
void setCurrentColor (const RGBColor &color)
 Sets the currently displayed color in the dialog.
void setHorizontal (bool horizontal)
 Sets the layout orientation of the dialog.
void setMargin (int x, int y, int xx, int yy)
 Sets the content margins of the dialog layout.
void setShowAlpha (bool show_alpha)
 Sets whether the alpha channel slider and input are visible.
void setVisible (bool visible) override
 Overrides QWidget::setVisible to handle showing and hiding the dialog.
bool showAlpha () const
 Returns whether the alpha channel controls are currently visible.

Static Public Member Functions

static Buffer< RGBColorColors (int count)
 Generates a buffer of evenly distributed colors.
static RGBColor customColor (int index)
 Returns the custom color at the given index.
static Buffer< RGBColorCustomColors ()
 Returns a buffer containing all custom colors.
static int customCount ()
 Returns the number of custom colors supported by the dialog.
static void setCustomColor (int index, RGBColor color)
 Sets the custom color at the given index.
static void setStandardColor (int index, RGBColor color)
 Sets the standard color at the given index.
static RGBColor standardColor (int index)
 Returns the standard color at the given index.

Protected Member Functions

void changeEvent (QEvent *event) override
 Handles change events such as language or palette changes.

Detailed Description

A dialog devoted to allowing the user to select a custom color.


Definition at line 16 of file QCustomColorDialog.h.

Constructor & Destructor Documentation

◆ QCustomColorDialog() [1/3]

QCustomColorDialog::QCustomColorDialog ( QWidget * parent = nullptr)
explicit

Constructs a QCustomColorDialog with the given parent widget.

Parameters
[in]parentThe parent widget.

◆ QCustomColorDialog() [2/3]

QCustomColorDialog::QCustomColorDialog ( const RGBColor & initial,
QWidget * parent = nullptr )
explicit

Constructs a QCustomColorDialog with an initial color and the given parent widget.

Parameters
[in]initialThe initial color to display.
[in]parentThe parent widget.

◆ QCustomColorDialog() [3/3]

QCustomColorDialog::QCustomColorDialog ( bool is_small,
bool show_line_edit_pickers,
QWidget * parent = nullptr )
explicit

Constructs a QCustomColorDialog with size and line edit picker options.

Parameters
[in]is_smallWhether to use a compact layout.
[in]show_line_edit_pickersWhether to show line edit pickers for manual color entry.
[in]parentThe parent widget.

Member Function Documentation

◆ changeEvent()

void QCustomColorDialog::changeEvent ( QEvent * event)
overrideprotected

Handles change events such as language or palette changes.

Parameters
[in]eventThe change event.

◆ Colors()

Buffer< RGBColor > QCustomColorDialog::Colors ( int count)
static

Generates a buffer of evenly distributed colors.

Parameters
[in]countThe number of colors to generate.
Returns
A Buffer of RGBColor values.

◆ colorSelected()

void QCustomColorDialog::colorSelected ( const RGBColor & color)

Emitted when a color is selected (confirmed) by the user.

Parameters
[in]colorThe selected color.

◆ currentColor()

RGBColor QCustomColorDialog::currentColor ( ) const

Returns the color currently being edited in the dialog.

Returns
The current color.

◆ currentColorEdited()

void QCustomColorDialog::currentColorEdited ( const RGBColor & color)

Emitted when the current color is changed by the user during editing.

Parameters
[in]colorThe new current color.

◆ customColor()

RGBColor QCustomColorDialog::customColor ( int index)
static

Returns the custom color at the given index.

Parameters
[in]indexThe index of the custom color.
Returns
The custom color at the specified index.

◆ CustomColors()

Buffer< RGBColor > QCustomColorDialog::CustomColors ( )
static

Returns a buffer containing all custom colors.

Returns
A Buffer of all custom RGBColor values.

◆ customCount()

int QCustomColorDialog::customCount ( )
static

Returns the number of custom colors supported by the dialog.

Returns
The custom color count.

◆ open()

void QCustomColorDialog::open ( QObject * receiver,
const char * member )

Opens the dialog and connects its finished signal to the specified receiver and member slot.

Parameters
[in]receiverThe object to receive the finished signal.
[in]memberThe slot to invoke when the dialog finishes.

◆ selectedColor()

RGBColor QCustomColorDialog::selectedColor ( ) const

Returns the color that was last selected (confirmed) by the user.

Returns
The selected color.

◆ setCurrentColor()

void QCustomColorDialog::setCurrentColor ( const RGBColor & color)

Sets the currently displayed color in the dialog.

Parameters
[in]colorThe color to set as the current selection.

◆ setCustomColor()

void QCustomColorDialog::setCustomColor ( int index,
RGBColor color )
static

Sets the custom color at the given index.

Parameters
[in]indexThe index of the custom color slot.
[in]colorThe color to store at the specified index.

◆ setHorizontal()

void QCustomColorDialog::setHorizontal ( bool horizontal)

Sets the layout orientation of the dialog.

Parameters
[in]horizontalWhether to use a horizontal layout.

◆ setMargin()

void QCustomColorDialog::setMargin ( int x,
int y,
int xx,
int yy )

Sets the content margins of the dialog layout.

Parameters
[in]xLeft margin.
[in]yTop margin.
[in]xxRight margin.
[in]yyBottom margin.

◆ setShowAlpha()

void QCustomColorDialog::setShowAlpha ( bool show_alpha)

Sets whether the alpha channel slider and input are visible.

Parameters
[in]show_alphaWhether to show the alpha channel controls.

◆ setStandardColor()

void QCustomColorDialog::setStandardColor ( int index,
RGBColor color )
static

Sets the standard color at the given index.

Parameters
[in]indexThe index of the standard color slot.
[in]colorThe color to store at the specified index.

◆ setVisible()

void QCustomColorDialog::setVisible ( bool visible)
override

Overrides QWidget::setVisible to handle showing and hiding the dialog.

Parameters
[in]visibleWhether the dialog should be visible.

◆ showAlpha()

bool QCustomColorDialog::showAlpha ( ) const

Returns whether the alpha channel controls are currently visible.

Returns
True if alpha controls are shown, false otherwise.

◆ standardColor()

RGBColor QCustomColorDialog::standardColor ( int index)
static

Returns the standard color at the given index.

Parameters
[in]indexThe index of the standard color.
Returns
The standard color at the specified index.

The documentation for this class was generated from the following file: