qbarset.h
60 lines
| 1.4 KiB
| text/x-c
|
CLexer
|
r169 | #ifndef QBARSET_H | ||
#define QBARSET_H | ||||
|
r276 | #include <qchartglobal.h> | ||
|
r183 | #include <QPen> | ||
#include <QBrush> | ||||
|
r169 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r239 | class QTCOMMERCIALCHART_EXPORT QBarSet : public QObject | ||
|
r169 | { | ||
|
r240 | Q_OBJECT | ||
|
r169 | public: | ||
|
r280 | QBarSet(QString name, QObject *parent = 0); | ||
|
r169 | |||
void setName(QString name); | ||||
|
r171 | QString name(); | ||
|
r183 | QBarSet& operator << (const qreal &value); // appends new value to set | ||
|
r169 | |||
|
r183 | int count(); // count of values in set | ||
qreal valueAt(int index); // for modifying individual values | ||||
|
r280 | void setValue(int index, qreal value); // setter for individual value | ||
|
r171 | |||
|
r357 | void setPen(QPen pen); | ||
QPen pen(); | ||||
|
r214 | |||
|
r357 | void setBrush(QBrush brush); | ||
QBrush brush(); | ||||
|
r214 | |||
|
r263 | Q_SIGNALS: | ||
|
r296 | void clicked(); // Clicked and hover signals exposed to user | ||
|
r288 | void hoverEnter(QPoint pos); | ||
|
r239 | void hoverLeave(); | ||
|
r296 | // TODO: Expose this to user or not? | ||
// TODO: TO PIMPL ---> | ||||
void toggleFloatingValues(); | ||||
void showToolTip(QPoint pos, QString tip); // Private signal | ||||
// <--- TO PIMPL | ||||
|
r280 | |||
|
r296 | public Q_SLOTS: | ||
// These are for internal communication | ||||
// TODO: TO PIMPL ---> | ||||
|
r239 | void barClicked(); | ||
|
r283 | void barHoverEntered(QPoint pos); | ||
|
r276 | void barHoverLeaved(); | ||
|
r296 | // <--- TO PIMPL | ||
|
r239 | |||
|
r171 | private: | ||
|
r169 | |||
QString mName; | ||||
QList<qreal> mValues; | ||||
|
r214 | QPen mPen; | ||
QBrush mBrush; | ||||
|
r239 | |||
|
r169 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSET_H | ||||