##// END OF EJS Templates
Fixed bug in setting chart theme...
Fixed bug in setting chart theme The bug was that if you first add a series, then change theme and then restore the original theme, the color of the series was changed even though it should have been restored to match the original color.

File last commit:

r283:b72248832d09
r312:0677c9dd6d92
Show More
bar_p.h
55 lines | 1.1 KiB | text/x-c | CLexer
#ifndef BAR_H
#define BAR_H
#include "qchartglobal.h"
#include <QGraphicsObject>
#include <QPen>
#include <QBrush>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
// Single visual bar item of chart
class Bar : public QGraphicsObject
{
Q_OBJECT
public:
Bar(QGraphicsItem *parent=0);
public: // from ChartItem
void setSize(const QSizeF &size);
// Layout Stuff
void resize(qreal w, qreal h);
void setPos(qreal x, qreal y);
void setPen(QPen pen);
void setBrush(QBrush brush);
public:
// From QGraphicsItem
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
QRectF boundingRect() const;
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
Q_SIGNALS:
void clicked();
void hoverEntered(QPoint pos);
void hoverLeaved();
private:
qreal mHeight;
qreal mWidth;
qreal mXpos;
qreal mYpos;
QColor mColor;
QBrush mBrush;
QPen mPen;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // BAR_H