|
QtiPlot
0.9.8.2
|
A modified QComboBox used for color selection. More...
#include <ColorBox.h>
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 QList< QColor > | colorList () |
| Return the list of colors. | |
| static QStringList | colorNames () |
| Returns the color names. | |
| static QColor | defaultColor (int colorIndex) |
| Return the default color at index 'colorIndex'. | |
| static QStringList | defaultColorNames () |
| Returns the color name for the predefined colors. | |
| static QList< QColor > | defaultColors () |
| Returns the list of predefined colors. | |
| 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. | |
A modified QComboBox used for color selection.
It contains a list of 24 predefined colors.
| ColorBox::ColorBox | ( | QWidget * | parent = 0 | ) |
| QColor ColorBox::color | ( | ) | const |
Return the current color.
Referenced by Fit::showConfidenceLimits(), Fit::showPredictionLimits(), and Fit::showResiduals().
| QColor ColorBox::color | ( | int | colorIndex | ) | [static] |
Return the color at index 'colorIndex'.
References colorList().
| 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().
| QList< QColor > ColorBox::colorList | ( | ) | [static] |
Return the list of colors.
References colors, and colors_count.
Referenced by color(), ColorButton::ColorButton(), colorIndex(), init(), and isValidColor().
| QStringList ColorBox::colorNames | ( | ) | [static] |
Returns the color names.
References defaultColorNames().
Referenced by ColorButton::ColorButton(), and init().
| QColor ColorBox::defaultColor | ( | int | colorIndex | ) | [static] |
Return the default color at index 'colorIndex'.
References colorIndex(), and colors.
Referenced by Graph::addFunction(), Grid::load(), ApplicationWindow::openGraph(), ApplicationWindow::readColorFromProject(), Filter::setColor(), Graph::setCurveLineColor(), and MultiPeakFit::setPeakCurvesColor().
| QStringList ColorBox::defaultColorNames | ( | ) | [static] |
Returns the color name for the predefined colors.
Referenced by ColorButton::ColorButton(), colorNames(), ConfigDialog::loadDefaultColors(), and ApplicationWindow::setDefaultOptions().
| QList< QColor > ColorBox::defaultColors | ( | ) | [static] |
Returns the list of predefined colors.
References colors, and colors_count.
Referenced by ColorButton::ColorButton(), Graph::guessUniqueCurveLayout(), Graph::initCurveLayout(), ConfigDialog::loadDefaultColors(), Graph::plotBox(), ApplicationWindow::setDefaultOptions(), and Graph::setIndexedColors().
| void ColorBox::init | ( | ) | [protected] |
Internal initialization function.
References colorList(), and colorNames().
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 colorList().
Referenced by colorIndex(), and Filter::setColor().
| int ColorBox::numPredefinedColors | ( | ) | [static] |
Returns the number of predefined colors.
References colors_count.
Referenced by PieCurve::color(), and ColorButton::ColorButton().
| void ColorBox::setColor | ( | const QColor & | c | ) |
Set the current color.
References colorIndex().
const QColor ColorBox::colors [static, protected] |
{
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().
const int ColorBox::colors_count = 24 [static, protected] |
The number of predefined colors.
Referenced by colorList(), defaultColors(), and numPredefinedColors().
1.7.6.1