casa
5.7.0-16
|
A widget that lets the user select a color: either one from a list, or a custom color. More...
#include <RSUtils.qo.h>
Public Member Functions | |
QtColorWidget (bool showButton=false, casacore::String setText="", QWidget *parent=NULL) | |
Constructor that uses default colors. More... | |
QtColorWidget (const std::vector< casacore::String > &colors, bool showButton=false, casacore::String setText="", QWidget *parent=NULL) | |
Constructor that uses the given colors. More... | |
~QtColorWidget () | |
Destructor. More... | |
casacore::String | getColor () const |
Returns the color that the user has chosen. More... | |
void | setColor (const casacore::String &color) |
Sets the displayed color to the given. More... | |
Static Public Member Functions | |
static std::vector < casacore::String > | defaultColors () |
Returns default colors. More... | |
Private Slots | |
void | colorChanged (int index) |
For when the user picks a different color in the chooser. More... | |
void | colorPick () |
For when the user clicks the "pick" button. More... | |
Private Member Functions | |
void | init (const std::vector< casacore::String > &colors, const casacore::String &setText, bool showButton) |
Initializes GUI members. More... | |
Private Attributes | |
QComboBox * | m_chooser |
Color chooser. More... | |
QLineEdit * | m_edit |
Custom color. More... | |
QPushButton * | m_button |
Picker button. More... | |
A widget that lets the user select a color: either one from a list, or a custom color.
Definition at line 253 of file RSUtils.qo.h.
casa::QtColorWidget::QtColorWidget | ( | bool | showButton = false , |
casacore::String | setText = "" , |
||
QWidget * | parent = NULL |
||
) |
Constructor that uses default colors.
If setText is nonempty, the chooser is set to the given. If showButton is true, a "pick" button is shown for picking colors.
casa::QtColorWidget::QtColorWidget | ( | const std::vector< casacore::String > & | colors, |
bool | showButton = false , |
||
casacore::String | setText = "" , |
||
QWidget * | parent = NULL |
||
) |
Constructor that uses the given colors.
If setText is nonempty, the chooser is set to the given. If showButton is true, a "pick" button is shown for picking colors.
casa::QtColorWidget::~QtColorWidget | ( | ) |
Destructor.
|
privateslot |
For when the user picks a different color in the chooser.
|
privateslot |
For when the user clicks the "pick" button.
|
inlinestatic |
Returns default colors.
Definition at line 283 of file RSUtils.qo.h.
casacore::String casa::QtColorWidget::getColor | ( | ) | const |
Returns the color that the user has chosen.
This will either be from the initial list, or in "#000000" form (see QColor::name()).
|
private |
Initializes GUI members.
void casa::QtColorWidget::setColor | ( | const casacore::String & | color | ) |
Sets the displayed color to the given.
If the color is in the colors list, that index will be selected – otherwise it will be entered in the custom color box.
|
private |
Picker button.
Definition at line 305 of file RSUtils.qo.h.
|
private |
Color chooser.
Definition at line 299 of file RSUtils.qo.h.
|
private |
Custom color.
Definition at line 302 of file RSUtils.qo.h.