qbarset.h
60 lines
| 1.4 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
|
r357 | void setPen(QPen pen); | ||
QPen pen(); | ||||
sauimone
|
r214 | |||
sauimone
|
r357 | void setBrush(QBrush brush); | ||
QBrush brush(); | ||||
sauimone
|
r214 | |||
sauimone
|
r263 | Q_SIGNALS: | ||
sauimone
|
r296 | void clicked(); // Clicked and hover signals exposed to user | ||
sauimone
|
r288 | void hoverEnter(QPoint pos); | ||
sauimone
|
r239 | void hoverLeave(); | ||
sauimone
|
r296 | // TODO: Expose this to user or not? | ||
// TODO: TO PIMPL ---> | ||||
void toggleFloatingValues(); | ||||
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 barClickedEvent(); | ||
void barHoverEnterEvent(QPoint pos); | ||||
void barHoverLeaveEvent(); | ||||
sauimone
|
r296 | // <--- TO PIMPL | ||
sauimone
|
r239 | |||
sauimone
|
r171 | private: | ||
sauimone
|
r169 | |||
QString mName; | ||||
QList<qreal> mValues; | ||||
sauimone
|
r214 | QPen mPen; | ||
QBrush mBrush; | ||||
sauimone
|
r239 | |||
sauimone
|
r169 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSET_H | ||||