qbarset.h
70 lines
| 1.9 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
|
r430 | // TODO: remove indices eventually. Use as internal? | ||
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
|
r438 | qreal total(); // total values in the set | ||
sauimone
|
r171 | |||
sauimone
|
r430 | // TODO: | ||
//qreal value(QString category); | ||||
//void setValue(QString category, qreal value); | ||||
sauimone
|
r473 | void setPen(const QPen pen); | ||
QPen pen() const; | ||||
sauimone
|
r214 | |||
sauimone
|
r473 | void setBrush(const QBrush brush); | ||
QBrush brush() const; | ||||
sauimone
|
r214 | |||
sauimone
|
r512 | void setFloatingValuePen(const QPen pen); | ||
QPen floatingValuePen() const; | ||||
sauimone
|
r263 | Q_SIGNALS: | ||
sauimone
|
r425 | void clicked(QString category); // Clicked and hover signals exposed to user | ||
void rightClicked(QString category); | ||||
void toggleFloatingValues(); | ||||
sauimone
|
r239 | |||
sauimone
|
r296 | // TODO: Expose this to user or not? | ||
// TODO: TO PIMPL ---> | ||||
sauimone
|
r425 | void hoverEnter(QPoint pos); | ||
void hoverLeave(); | ||||
sauimone
|
r296 | void showToolTip(QPoint pos, QString tip); // Private signal | ||
// <--- TO PIMPL | ||||
sauimone
|
r280 | |||
sauimone
|
r296 | public Q_SLOTS: | ||
// These are for internal communication | ||||
// TODO: TO PIMPL ---> | ||||
sauimone
|
r412 | void barHoverEnterEvent(QPoint pos); | ||
void barHoverLeaveEvent(); | ||||
sauimone
|
r296 | // <--- TO PIMPL | ||
sauimone
|
r239 | |||
sauimone
|
r171 | private: | ||
sauimone
|
r169 | |||
QString mName; | ||||
sauimone
|
r430 | QList<qreal> mValues; // TODO: replace with map (category, value) | ||
QMap<QString,qreal> mMappedValues; | ||||
sauimone
|
r214 | QPen mPen; | ||
QBrush mBrush; | ||||
sauimone
|
r512 | QPen mFloatingValuePen; | ||
sauimone
|
r169 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSET_H | ||||