pqColorChooserButtonWithPalettes extends pqColorChooserButton to add support for a menu that allows the user to connect the color to a color in the ParaView application's color palettes. More...
#include <pqColorChooserButtonWithPalettes.h>
Public Member Functions | |
pqColorChooserButtonWithPalettes (QWidget *parent=nullptr) | |
~pqColorChooserButtonWithPalettes () override | |
![]() | |
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) |
Friends | |
class | pqColorPaletteLinkHelper |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
void | chosenColorChanged (const QColor &) |
signal color changed. More... | |
void | validColorChosen (const QColor &) |
signal color selected. More... | |
![]() | |
void | resizeEvent (QResizeEvent *rEvent) override |
overridden to resize the color icon. More... | |
QIcon | renderColorSwatch (const QColor &) |
renders an icon for the color. More... | |
![]() | |
double | Color [4] |
RGBA values representing the chosen color. More... | |
double | IconRadiusHeightRatio |
the ratio of icon radius to button height More... | |
bool | ShowAlphaChannel |
![]() | |
QColor | chosenColor |
QVariantList | chosenColorRgbF |
QVariantList | chosenColorRgbaF |
bool | showAlphaChannel |
pqColorChooserButtonWithPalettes extends pqColorChooserButton to add support for a menu that allows the user to connect the color to a color in the ParaView application's color palettes.
When the user selects a color from the color palette, this class will get the color value from the palette and simply apply it, as if the user explicitly chose the color.
However, in ParaView, when the user selects a color from the palette, there's an expectation that the color stays "linked" with the color palette. Thus, if the color palette is changed, the linked color is also updated.
To achieve that, pqColorChooserButtonWithPalettes is often used with a pqColorPaletteLinkHelper. Simply instantiate a pqColorPaletteLinkHelper instance with appropriate constructor arguments and then linking of properties with the color palette is automatically managed.
Definition at line 35 of file pqColorChooserButtonWithPalettes.h.
pqColorChooserButtonWithPalettes::pqColorChooserButtonWithPalettes | ( | QWidget * | parent = nullptr | ) |
|
override |
|
friend |
Definition at line 64 of file pqColorChooserButtonWithPalettes.h.