QtiPlot  0.9.8.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
ColorBox Class Reference

A modified QComboBox used for color selection. More...

#include <ColorBox.h>

Inheritance diagram for ColorBox:

Public Member Functions

QColor color () const
 Return the current color. More...
 
 ColorBox (QWidget *parent=0)
 Constructor. More...
 
void setColor (const QColor &c)
 Set the current color. More...
 

Static Public Member Functions

static QColor color (int colorIndex)
 Return the color at index 'colorIndex'. More...
 
static int colorIndex (const QColor &c)
 Return the index for a given color. More...
 
static QList< QColor > colorList ()
 Return the list of colors. More...
 
static QStringList colorNames ()
 Returns the color names. More...
 
static QColor defaultColor (int colorIndex)
 Return the default color at index 'colorIndex'. More...
 
static QStringList defaultColorNames ()
 Returns the color name for the predefined colors. More...
 
static QList< QColor > defaultColors ()
 Returns the list of predefined colors. More...
 
static bool isValidColor (const QColor &color)
 Returns TRUE if the color is included in the color box, otherwise returns FALSE. More...
 
static int numPredefinedColors ()
 Returns the number of predefined colors. More...
 

Protected Member Functions

void init ()
 Internal initialization function. More...
 

Static Protected Attributes

static const QColor colors []
 Array containing the 24 predefined colors. More...
 
static const int colors_count = 24
 The number of predefined colors. More...
 

Detailed Description

A modified QComboBox used for color selection.

It contains a list of 24 predefined colors.

Constructor & Destructor Documentation

§ ColorBox()

ColorBox::ColorBox ( QWidget *  parent = 0)

Constructor.

Parameters
parentparent widget

References init().

Member Function Documentation

§ color() [1/2]

QColor ColorBox::color ( ) const

§ color() [2/2]

QColor ColorBox::color ( int  colorIndex)
static

Return the color at index 'colorIndex'.

References colorList().

§ colorIndex()

int ColorBox::colorIndex ( const QColor &  c)
static

Return the index for a given color.

References colorList(), and isValidColor().

Referenced by defaultColor(), setColor(), Fit::showConfidenceLimits(), Fit::showPredictionLimits(), and Fit::showResiduals().

§ colorList()

QList< QColor > ColorBox::colorList ( )
static

Return the list of colors.

References colors, and colors_count.

Referenced by color(), ColorButton::ColorButton(), colorIndex(), init(), and isValidColor().

§ colorNames()

QStringList ColorBox::colorNames ( )
static

Returns the color names.

References defaultColorNames().

Referenced by ColorButton::ColorButton(), and init().

§ defaultColor()

QColor ColorBox::defaultColor ( int  colorIndex)
static

§ defaultColorNames()

QStringList ColorBox::defaultColorNames ( )
static

Returns the color name for the predefined colors.

Referenced by ColorButton::ColorButton(), colorNames(), ConfigDialog::loadDefaultColors(), and ApplicationWindow::setDefaultOptions().

§ defaultColors()

QList< QColor > ColorBox::defaultColors ( )
static

§ init()

void ColorBox::init ( )
protected

Internal initialization function.

References colorList(), and colorNames().

Referenced by ColorBox().

§ isValidColor()

bool ColorBox::isValidColor ( const QColor &  color)
static

Returns TRUE if the color is included in the color box, otherwise returns FALSE.

References colorList().

Referenced by colorIndex(), and Filter::setColor().

§ numPredefinedColors()

int ColorBox::numPredefinedColors ( )
static

Returns the number of predefined colors.

References colors_count.

Referenced by PieCurve::color(), and ColorButton::ColorButton().

§ setColor()

void ColorBox::setColor ( const QColor &  c)

Set the current color.

References colorIndex().

Member Data Documentation

§ colors

const QColor ColorBox::colors
staticprotected
Initial value:
= {
QColor(Qt::black),
QColor(Qt::red),
QColor(Qt::green),
QColor(Qt::blue),
QColor(Qt::cyan),
QColor(Qt::magenta),
QColor(Qt::yellow),
QColor(Qt::darkYellow),
QColor(Qt::darkBlue),
QColor(Qt::darkMagenta),
QColor(Qt::darkRed),
QColor(Qt::darkGreen),
QColor(Qt::darkCyan),
QColor("#0000A0"),
QColor("#FF8000"),
QColor("#8000FF"),
QColor("#FF0080"),
QColor(Qt::white),
QColor(Qt::lightGray),
QColor(Qt::gray),
QColor("#FFFF80"),
QColor("#80FFFF"),
QColor("#FF80FF"),
QColor(Qt::darkGray),
}

Array containing the 24 predefined colors.

Referenced by colorList(), defaultColor(), and defaultColors().

§ colors_count

const int ColorBox::colors_count = 24
staticprotected

The number of predefined colors.

Referenced by colorList(), defaultColors(), and numPredefinedColors().


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