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


Member Function Documentation

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

Return the color at index 'colorindex'.

QColor ColorBox::color (  )  const

Return the current color.

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

Return the index for a given color.

void ColorBox::init (  )  [protected]

Internal initialization function.

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

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

int ColorBox::numPredefinedColors (  )  [static]

Returns the number of predefined colors.

void ColorBox::setColor ( const QColor &  c  ) 

Set the current color.


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.

const int ColorBox::colors_count = 24 [static, protected]

The number of predefined colors.


The documentation for this class was generated from the following files:
Generated on Thu Feb 7 13:59:28 2008 for QtiPlot by  doxygen 1.5.4