KD Chart 2
[rev.2.7]
|
A Palette is a set of brushes (or colors) to be used for painting data sets. More...
#include <KDChartPalette.h>
Signals | |
void | changed () |
Emitted whenever the palette changes. More... | |
Public Member Functions | |
void | addBrush (const QBrush &brush, int position=-1) |
Adds brush to the palette. More... | |
QBrush | getBrush (int position) const |
Query the palette for a brush at the specified position. More... | |
bool | isValid () const |
Palette & | operator= (const Palette &) |
Palette (QObject *parent=0) | |
Palette (const Palette &) | |
void | removeBrush (int position) |
Remove the brush at position position, if there is one. More... | |
int | size () const |
~Palette () override | |
Static Public Member Functions | |
static const Palette & | defaultPalette () |
Provide access to the three builtin palettes, one with standard bright colors, one with more subdued colors, and one with rainbow colors. More... | |
static const Palette & | rainbowPalette () |
static const Palette & | subduedPalette () |
A Palette is a set of brushes (or colors) to be used for painting data sets.
The palette class encapsulates a colletion of brushes, which in the simplest case are colors, to be used for painting a series of data sets. When asked for the m-th color, a palette of size n will wrap around and thus cycle through the available colors.
Three builtin palettes are provided for convenience, one with a default set of colors, one with a subdued color selection, one with rainbow colors.
When a palette changes, it emits a changed() signal. Hook up to it, if you want to repaint when the color selection changes.
Definition at line 49 of file KDChartPalette.h.
|
explicit |
Definition at line 125 of file KDChartPalette.cpp.
Palette::Palette | ( | const Palette & | r | ) |
Definition at line 138 of file KDChartPalette.cpp.
|
override |
Definition at line 131 of file KDChartPalette.cpp.
void Palette::addBrush | ( | const QBrush & | brush, |
int | position = -1 |
||
) |
Adds brush to the palette.
If no position is specified, the brush is appended.
Definition at line 162 of file KDChartPalette.cpp.
|
signal |
Emitted whenever the palette changes.
Views listen to this and repaing.
Referenced by addBrush(), and removeBrush().
|
static |
Provide access to the three builtin palettes, one with standard bright colors, one with more subdued colors, and one with rainbow colors.
Definition at line 107 of file KDChartPalette.cpp.
Referenced by KDChart::Legend::setDefaultColors(), and KDChart::AttributesModel::setPaletteType().
QBrush Palette::getBrush | ( | int | position | ) | const |
Query the palette for a brush at the specified position.
If the position exceeds the size of the palette, it wraps around.
Definition at line 172 of file KDChartPalette.cpp.
References d, isValid(), and size().
Referenced by KDChart::Legend::setDefaultColors(), KDChart::Legend::setRainbowColors(), and KDChart::Legend::setSubduedColors().
bool Palette::isValid | ( | ) | const |
Definition at line 152 of file KDChartPalette.cpp.
References d.
Referenced by getBrush().
Definition at line 143 of file KDChartPalette.cpp.
|
static |
Definition at line 119 of file KDChartPalette.cpp.
Referenced by KDChart::AttributesModel::setPaletteType(), and KDChart::Legend::setRainbowColors().
void Palette::removeBrush | ( | int | position | ) |
Remove the brush at position position, if there is one.
Definition at line 178 of file KDChartPalette.cpp.
int Palette::size | ( | ) | const |
Definition at line 157 of file KDChartPalette.cpp.
References d.
Referenced by addBrush(), getBrush(), removeBrush(), KDChart::Legend::setDefaultColors(), KDChart::Legend::setRainbowColors(), and KDChart::Legend::setSubduedColors().
|
static |
Definition at line 113 of file KDChartPalette.cpp.
Referenced by KDChart::AttributesModel::setPaletteType(), and KDChart::Legend::setSubduedColors().