ColorBox Class Reference

#include <ColorBox.h>

List of all members.


Detailed Description

A combo box to select a standard color.

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.

Constructor & Destructor Documentation

ColorBox::ColorBox ( QWidget *  parent = 0  ) 

Constructor.

Parameters:
parent parent widget

References init().


Member Function Documentation

QColor ColorBox::color ( int  colorIndex  )  [static]

Return the color at index 'colorindex'.

References colors.

QColor ColorBox::color (  )  const

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

Return the index for a given color.

References colors.

Referenced by 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 [static, protected]

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 [static, protected]

The number of predefined colors.

Referenced by isValidColor(), and numPredefinedColors().


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

Generated on Tue Jun 17 08:36:15 2008 for QtiPlot by  doxygen 1.5.5