SciDAVis  1.D4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
ColorBox Class Reference

A combo box to select a standard color. More...

#include <ColorBox.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

static QColor color (int colorIndex)
 Return the color at index 'colorindex'.
static int colorIndex (const QColor &c)
 Return the index for a given color.
static bool isValidColor (const QColor &color)
 Returns TRUE if the color is included in the color box, otherwise returns FALSE.
static int numPredefinedColors ()
 Returns the number of predefined colors.

Protected Member Functions

void init ()
 Internal initialization function.

Static Protected Attributes

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

Detailed Description

A combo box to select a standard color.


Constructor & Destructor Documentation

ColorBox::ColorBox ( QWidget *  parent = 0)

Constructor.

Parameters:
parentparent widget

References init().


Member Function Documentation

QColor ColorBox::color ( ) const
QColor ColorBox::color ( int  colorIndex)
static

Return the color at index 'colorindex'.

References colorIndex(), and colors.

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

Return the index for a given color.

References colors.

Referenced by color(), Graph::guessUniqueCurveLayout(), Graph::saveCurveLayout(), and Filter::setColor().

void ColorBox::init ( )
protected

Internal initialization function.

References colors.

Referenced by ColorBox().

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

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

References colors, and colors_count.

Referenced by Filter::setColor().

int ColorBox::numPredefinedColors ( )
static

Returns the number of predefined colors.

References colors_count.

Referenced by QwtPieCurve::color().

void ColorBox::setColor ( const QColor &  c)

Member Data Documentation

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 color(), colorIndex(), init(), isValidColor(), and setColor().

const int ColorBox::colors_count = 24
staticprotected

The number of predefined colors.

Referenced by isValidColor(), and numPredefinedColors().


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