KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Member Functions | List of all members
KDChart::Palette Class Reference

A Palette is a set of brushes (or colors) to be used for painting data sets. More...

#include <KDChartPalette.h>

Inheritance diagram for KDChart::Palette:
Inheritance graph
[legend]
Collaboration diagram for KDChart::Palette:
Collaboration graph
[legend]

Signals

void changed ()
 

Public Member Functions

 Palette (const Palette &)
 
 Palette (QObject *parent=nullptr)
 
 ~Palette () override
 
void addBrush (const QBrush &brush, int position=-1)
 
QBrush getBrush (int position) const
 
bool isValid () const
 
Paletteoperator= (const Palette &)
 
void removeBrush (int position)
 
int size () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
T qFindChild (const QObject *obj, const QString &name)
 
QList< TqFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< TqFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static const PalettedefaultPalette ()
 
static const PaletterainbowPalette ()
 
static const PalettesubduedPalette ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A Palette is a set of brushes (or colors) to be used for painting data sets.

The palette class encapsulates a collection 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 37 of file KDChartPalette.h.

Constructor & Destructor Documentation

◆ Palette() [1/2]

Palette::Palette ( QObject parent = nullptr)
explicit

Definition at line 119 of file KDChartPalette.cpp.

◆ Palette() [2/2]

Palette::Palette ( const Palette r)

Definition at line 131 of file KDChartPalette.cpp.

◆ ~Palette()

Palette::~Palette ( )
override

Definition at line 125 of file KDChartPalette.cpp.

Member Function Documentation

◆ addBrush()

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 156 of file KDChartPalette.cpp.

References changed(), d, QObject::Q_EMIT(), QObject::qobject_cast(), and size().

◆ changed

void KDChart::Palette::changed ( )
signal

Emitted whenever the palette changes. Views listen to this and repaing.

Referenced by addBrush(), and removeBrush().

◆ defaultPalette()

const Palette & Palette::defaultPalette ( )
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 101 of file KDChartPalette.cpp.

References QObject::qobject_cast().

Referenced by KDChart::Legend::setDefaultColors(), and KDChart::AttributesModel::setPaletteType().

◆ getBrush()

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 166 of file KDChartPalette.cpp.

References d, isValid(), and size().

◆ isValid()

bool Palette::isValid ( ) const
Returns
whether this represents a valid palette. For a palette to be valid it needs to have at least one brush associated.

Definition at line 146 of file KDChartPalette.cpp.

References d, and size().

Referenced by getBrush().

◆ operator=()

Definition at line 137 of file KDChartPalette.cpp.

◆ rainbowPalette()

const Palette & Palette::rainbowPalette ( )
static

◆ removeBrush()

void Palette::removeBrush ( int  position)

Remove the brush at position position, if there is one.

Definition at line 173 of file KDChartPalette.cpp.

References changed(), d, QObject::Q_EMIT(), QObject::qobject_cast(), and size().

◆ size()

int Palette::size ( ) const
Returns
the number of brushed in the palette.

Definition at line 151 of file KDChartPalette.cpp.

References d.

Referenced by addBrush(), getBrush(), isValid(), and removeBrush().

◆ subduedPalette()

const Palette & Palette::subduedPalette ( )
static

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

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated on Fri Apr 26 2024 00:04:57 for KD Chart API Documentation by doxygen 1.9.8