qbarset.h
63 lines
| 1.8 KiB
| text/x-c
|
CLexer
sauimone
|
r169 | #ifndef QBARSET_H | ||
#define QBARSET_H | ||||
sauimone
|
r276 | #include <qchartglobal.h> | ||
sauimone
|
r183 | #include <QPen> | ||
#include <QBrush> | ||||
sauimone
|
r169 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
sauimone
|
r239 | class QTCOMMERCIALCHART_EXPORT QBarSet : public QObject | ||
sauimone
|
r169 | { | ||
sauimone
|
r240 | Q_OBJECT | ||
sauimone
|
r169 | public: | ||
sauimone
|
r280 | QBarSet(QString name, QObject *parent = 0); | ||
sauimone
|
r169 | |||
void setName(QString name); | ||||
sauimone
|
r171 | QString name(); | ||
sauimone
|
r183 | QBarSet& operator << (const qreal &value); // appends new value to set | ||
sauimone
|
r169 | |||
sauimone
|
r183 | int count(); // count of values in set | ||
qreal valueAt(int index); // for modifying individual values | ||||
sauimone
|
r280 | void setValue(int index, qreal value); // setter for individual value | ||
sauimone
|
r171 | |||
sauimone
|
r214 | void setPen(const QPen& pen); | ||
const QPen& pen() const; | ||||
void setBrush(const QBrush& brush); | ||||
const QBrush& brush() const; | ||||
sauimone
|
r263 | Q_SIGNALS: | ||
sauimone
|
r280 | void clicked(); // Clicked and hover signals exposed to user | ||
sauimone
|
r288 | void hoverEnter(QPoint pos); | ||
sauimone
|
r239 | void hoverLeave(); | ||
sauimone
|
r288 | void toggleFloatingValues(); // Private signal, TODO: move to private impl | ||
void showToolTip(QPoint pos, QString tip); // Private signal, TODO: move to private impl | ||||
sauimone
|
r239 | |||
public Q_SLOTS: | ||||
sauimone
|
r280 | void enableFloatingValues(bool enabled); // enables floating values on top of bars | ||
sauimone
|
r283 | void enableToolTip(bool enabled); // enables tooltips | ||
sauimone
|
r288 | void enableSeparators(bool enabled); // enables separators between categories | ||
sauimone
|
r280 | |||
// TODO: these slots belong to private implementation. | ||||
// These are for single bars to notify set about internal events | ||||
sauimone
|
r239 | void barClicked(); | ||
sauimone
|
r283 | void barHoverEntered(QPoint pos); | ||
sauimone
|
r276 | void barHoverLeaved(); | ||
sauimone
|
r239 | |||
sauimone
|
r171 | private: | ||
sauimone
|
r169 | |||
QString mName; | ||||
QList<qreal> mValues; | ||||
sauimone
|
r214 | QPen mPen; | ||
QBrush mBrush; | ||||
sauimone
|
r239 | |||
sauimone
|
r280 | // TODO: to pimpl | ||
bool mFloatingValuesEnabled; | ||||
sauimone
|
r288 | bool mToolTipEnabled; | ||
bool mSeparatorsEnabled; | ||||
sauimone
|
r169 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSET_H | ||||