#include <KDChartPalette.h>
Inheritance diagram for KDChart::Palette:
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 55 of file KDChartPalette.h.
Public Member Functions | |
void | addBrush (const QBrush &brush, int position=-1) |
Adds brush to the palette. | |
QBrush | getBrush (int position) const |
Query the palette for a brush at the specified position. | |
bool | isValid () const |
Returns wether this represents a valid palette. | |
Palette & | operator= (const Palette &) |
Palette (const Palette &) | |
Palette (QObject *parent=0) | |
void | removeBrush (int position) |
Remove the brush at position. | |
int | size () const |
Return the number of brushed in the palette. | |
~Palette () | |
Static Public Member Functions | |
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. | |
const Palette & | rainbowPalette () |
const Palette & | subduedPalette () |
Public Attributes | |
Q_SIGNALS | __pad0__: void changed() |
|
|
|
|
|
|
|
Adds brush to the palette. If no position is specified, the brush is appended. Referenced by makeDefaultPalette(), makeRainbowPalette(), and makeSubduedPalette(). |
|
Provide access to the three builtin palettes, one with standard bright colors, one with more subdued colors, and one with rainbow colors.
Referenced by KDChart::AttributesModel::headerData(). |
|
Query the palette for a brush at the specified position. If the position exceeds the size of the palette, it wraps around. Referenced by KDChart::AttributesModel::headerData(), and makeRainbowPalette(). |
|
Returns wether this represents a valid palette. For a palette to be valid it needs to have at least one brush associated. |
|
|
|
Referenced by KDChart::AttributesModel::headerData(). |
|
Remove the brush at position.
|
|
Return the number of brushed in the palette.
|
|
Referenced by KDChart::AttributesModel::headerData(). |
|
Definition at line 94 of file KDChartPalette.h. |