##// END OF EJS Templates
Fix test application to have valid window size
Fix test application to have valid window size

File last commit:

r13:335e8906dfcb
r147:ede69107bdd8
Show More
qscatterseries.cpp
30 lines | 817 B | text/x-c | CppLexer
Tero Ahola
Drafting scatter type plotting...
r8 #include "qscatterseries.h"
Tero Ahola
Scatter data point now shown using a picture
r13 #include "qseriespointgraphicsitem.h"
Tero Ahola
Drafting scatter type plotting...
r8 #include <QPainter>
Tero Ahola
Scatter data point now shown using a picture
r13 #include <QGraphicsScene>
Tero Ahola
Drafting scatter type plotting...
r8
QScatterSeries::QScatterSeries(QGraphicsItem *parent) :
QGraphicsItem(parent)
{
}
QRectF QScatterSeries::boundingRect() const
{
Tero Ahola
Scatter data point now shown using a picture
r13 return QRectF(0, 50, 100, 100);
Tero Ahola
Drafting scatter type plotting...
r8 }
void QScatterSeries::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Tero Ahola
Scatter data point now shown using a picture
r13 // painter->drawRect(boundingRect());
}
void QScatterSeries::setData(QList<QChartDataPoint> data)
//void QScatterSeries::setData(QList<int> data)
{
foreach(QChartDataPoint point, data) {
// TODO: ownership?
// TODO: position
QSeriesPointGraphicsItem *item = new QSeriesPointGraphicsItem(
point[0].toReal(), 100-point[1].toReal(), this);
}
Tero Ahola
Drafting scatter type plotting...
r8 }