ColorButton Class Reference

A button widget designed to select a color. More...

#include <colorbutton.h>

+ Inheritance diagram for ColorButton:

Signals

void colorUpdated (QColor oldColor, const QColor &newColor)
 

Public Member Functions

 ColorButton (QWidget *parent=nullptr)
 
QString colorHtml () const
 
const QColor & colorQ () const
 
unsigned colorUnsigned () const
 
void setColor (unsigned colorValue)
 
void setColorHtml (const QString &colorHtml)
 
QSize sizeHint () const override
 

Protected Slots

void thisClicked ()
 

Protected Member Functions

void updateAppearance ()
 
void updateColor (const QColor &newColor)
 Will always emit colorUpdated() signal.
 

Protected Attributes

QColor color
 

Detailed Description

A button widget designed to select a color.

This will paint itself in a color it represents. Clicking this button will bring up a standard color selection dialog box. Operating this control is as easy as it gets: Just drop it inside a container and either capture colorUpdated() signals or extract the color when ready through one of the color methods.

Definition at line 37 of file colorbutton.h.

Member Function Documentation

void ColorButton::updateColor ( const QColor &  newColor)
protected

Will always emit colorUpdated() signal.

Definition at line 86 of file colorbutton.cpp.


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