Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
pqColorChooserButton Class Reference

pqColorChooserButton is a QToolButton subclass suitable for showing a a button that allows the use to select/change color. More...

#include <pqColorChooserButton.h>

Inheritance diagram for pqColorChooserButton:
Inheritance graph
[legend]

Public Slots

virtual void setChosenColor (const QColor &)
 set the color More...
 
void setChosenColorRgbF (const QVariantList &)
 set the color as a QVariantList with exactly 3 QVariants with values in the range [0, 1] for each of the 3 color components. More...
 
void setChosenColorRgbaF (const QVariantList &)
 set the color as a QVariantList with exactly 4 QVariants with values in the range [0, 1] for each of the 4 color components. More...
 
virtual void chooseColor ()
 show a dialog to choose the color More...
 

Signals

void chosenColorChanged (const QColor &)
 signal color changed. More...
 
void validColorChosen (const QColor &)
 signal color selected. More...
 

Public Member Functions

 pqColorChooserButton (QWidget *p)
 constructor requires a QComboBox More...
 
QColor chosenColor () const
 get the color More...
 
QVariantList chosenColorRgbF () const
 Returns the chosen color as a QVariantList with exatctly 3 QVariants with values in the range [0, 1] for each of the 3 color components. More...
 
QVariantList chosenColorRgbaF () const
 Returns the chosen color as a QVariantList with exatctly 4 QVariants with values in the range [0, 1] for each of the 4 color components. More...
 
void setIconRadiusHeightRatio (double val)
 Set/Get the ratio of icon radius to button height. More...
 
double iconRadiusHeightRatio () const
 
bool showAlphaChannel () const
 When true, the widget will allow users to choose the alpha channel. More...
 
void setShowAlphaChannel (bool val)
 

Protected Member Functions

void resizeEvent (QResizeEvent *rEvent) override
 overridden to resize the color icon. More...
 
QIcon renderColorSwatch (const QColor &)
 renders an icon for the color. More...
 

Protected Attributes

double Color [4]
 RGBA values representing the chosen color. More...
 
double IconRadiusHeightRatio
 the ratio of icon radius to button height More...
 
bool ShowAlphaChannel
 

Properties

QColor chosenColor
 
QVariantList chosenColorRgbF
 
QVariantList chosenColorRgbaF
 
bool showAlphaChannel
 

Detailed Description

pqColorChooserButton is a QToolButton subclass suitable for showing a a button that allows the use to select/change color.

It renders a color swatch next to the button text matching the chosen color.

Definition at line 18 of file pqColorChooserButton.h.

Constructor & Destructor Documentation

◆ pqColorChooserButton()

pqColorChooserButton::pqColorChooserButton ( QWidget *  p)

constructor requires a QComboBox

Member Function Documentation

◆ chosenColor()

QColor pqColorChooserButton::chosenColor ( ) const

get the color

◆ chosenColorRgbF()

QVariantList pqColorChooserButton::chosenColorRgbF ( ) const

Returns the chosen color as a QVariantList with exatctly 3 QVariants with values in the range [0, 1] for each of the 3 color components.

◆ chosenColorRgbaF()

QVariantList pqColorChooserButton::chosenColorRgbaF ( ) const

Returns the chosen color as a QVariantList with exatctly 4 QVariants with values in the range [0, 1] for each of the 4 color components.

◆ setIconRadiusHeightRatio()

void pqColorChooserButton::setIconRadiusHeightRatio ( double  val)
inline

Set/Get the ratio of icon radius to button height.

Definition at line 52 of file pqColorChooserButton.h.

◆ iconRadiusHeightRatio()

double pqColorChooserButton::iconRadiusHeightRatio ( ) const
inline

Definition at line 53 of file pqColorChooserButton.h.

◆ showAlphaChannel()

bool pqColorChooserButton::showAlphaChannel ( ) const
inline

When true, the widget will allow users to choose the alpha channel.

Definition at line 58 of file pqColorChooserButton.h.

◆ setShowAlphaChannel()

void pqColorChooserButton::setShowAlphaChannel ( bool  val)
inline

Definition at line 59 of file pqColorChooserButton.h.

◆ chosenColorChanged

void pqColorChooserButton::chosenColorChanged ( const QColor &  )
signal

signal color changed.

This is fired in setChosenColor() only when the color is indeed different.

◆ validColorChosen

void pqColorChooserButton::validColorChosen ( const QColor &  )
signal

signal color selected.

Unlike chosenColorChanged() this is fired even if the color hasn't changed.

◆ setChosenColor

virtual void pqColorChooserButton::setChosenColor ( const QColor &  )
virtualslot

set the color

◆ setChosenColorRgbF

void pqColorChooserButton::setChosenColorRgbF ( const QVariantList &  )
slot

set the color as a QVariantList with exactly 3 QVariants with values in the range [0, 1] for each of the 3 color components.

◆ setChosenColorRgbaF

void pqColorChooserButton::setChosenColorRgbaF ( const QVariantList &  )
slot

set the color as a QVariantList with exactly 4 QVariants with values in the range [0, 1] for each of the 4 color components.

◆ chooseColor

virtual void pqColorChooserButton::chooseColor ( )
virtualslot

show a dialog to choose the color

◆ resizeEvent()

void pqColorChooserButton::resizeEvent ( QResizeEvent *  rEvent)
overrideprotected

overridden to resize the color icon.

◆ renderColorSwatch()

QIcon pqColorChooserButton::renderColorSwatch ( const QColor &  )
protected

renders an icon for the color.

Member Data Documentation

◆ Color

double pqColorChooserButton::Color[4]
protected

RGBA values representing the chosen color.

Definition at line 111 of file pqColorChooserButton.h.

◆ IconRadiusHeightRatio

double pqColorChooserButton::IconRadiusHeightRatio
protected

the ratio of icon radius to button height

Definition at line 116 of file pqColorChooserButton.h.

◆ ShowAlphaChannel

bool pqColorChooserButton::ShowAlphaChannel
protected

Definition at line 118 of file pqColorChooserButton.h.

Property Documentation

◆ chosenColor

QColor pqColorChooserButton::chosenColor
readwrite

Definition at line 21 of file pqColorChooserButton.h.

◆ chosenColorRgbF

QVariantList pqColorChooserButton::chosenColorRgbF
readwrite

Definition at line 21 of file pqColorChooserButton.h.

◆ chosenColorRgbaF

QVariantList pqColorChooserButton::chosenColorRgbaF
readwrite

Definition at line 22 of file pqColorChooserButton.h.

◆ showAlphaChannel

bool pqColorChooserButton::showAlphaChannel
readwrite

Definition at line 23 of file pqColorChooserButton.h.


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