barvalue_p.h
54 lines
| 1.0 KiB
| text/x-c
|
CLexer
sauimone
|
r263 | #ifndef BARVALUE_P_H | ||
#define BARVALUE_P_H | ||||
#include "qchartglobal.h" | ||||
sauimone
|
r273 | #include <QGraphicsObject> | ||
sauimone
|
r263 | #include <QPen> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
sauimone
|
r267 | class QBarSet; | ||
sauimone
|
r263 | |||
// Visual class for floating bar values | ||||
// TODO: fonts, colors etc. | ||||
// By default these are not visible. | ||||
sauimone
|
r273 | class BarValue : public QGraphicsObject | ||
sauimone
|
r263 | { | ||
sauimone
|
r273 | Q_OBJECT | ||
sauimone
|
r263 | public: | ||
sauimone
|
r267 | BarValue(QBarSet &set, QGraphicsItem *parent = 0); | ||
sauimone
|
r263 | |||
void setValueString(QString str); | ||||
QString valueString(); | ||||
void setPen(const QPen& pen); | ||||
const QPen& pen(); | ||||
void resize(qreal w, qreal h); | ||||
void setPos(qreal x, qreal y); | ||||
sauimone
|
r280 | // Propably not needed. | ||
// bool belongsToSet(QBarSet *set); | ||||
sauimone
|
r267 | |||
sauimone
|
r263 | // From QGraphicsItem | ||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
QRectF boundingRect() const; | ||||
sauimone
|
r273 | public Q_SLOTS: | ||
void toggleVisible(); | ||||
sauimone
|
r263 | private: | ||
sauimone
|
r267 | QBarSet& mBarSet; | ||
sauimone
|
r263 | QPen mPen; | ||
QString mValueString; | ||||
qreal mXpos; | ||||
qreal mYpos; | ||||
qreal mWidth; | ||||
qreal mHeight; | ||||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // BARVALUE_P_H | ||||