##// END OF EJS Templates
Bar chart prototyping
Bar chart prototyping

File last commit:

r1:e2b454419c47
r10:2932e9eb12b3
Show More
chartwidget.cpp
38 lines | 626 B | text/x-c | CppLexer
Jani Honkonen
First draft of project structure
r1 #include "chartwidget.h"
#include "../src/chart.h"
#include <QPainter>
class ChartWidgetPrivate : public Chart
{
public:
//Q_DECLARE_PUBLIC(ChartWidget)
ChartWidgetPrivate() {}
};
ChartWidget::ChartWidget(QWidget *parent)
: QWidget(parent)
{
d_ptr = new ChartWidgetPrivate();
}
ChartWidget::~ChartWidget()
{
delete d_ptr;
d_ptr = 0;
}
QColor ChartWidget::color() const
{
return d_ptr->color();
}
void ChartWidget::setColor(const QColor &color)
{
d_ptr->setColor(color);
}
void ChartWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
d_ptr->drawChart(&painter, rect());
}