2012-01-03 14:22:10 +00:00
|
|
|
#include "declarativechart.h"
|
|
|
|
#include <QPainter>
|
|
|
|
|
2012-01-03 15:29:22 +00:00
|
|
|
#ifndef QTQUICK2
|
2012-01-03 14:22:10 +00:00
|
|
|
DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent)
|
|
|
|
: QDeclarativeItem(parent)
|
|
|
|
{
|
|
|
|
// need to disable this flag to draw inside a QDeclarativeItem
|
|
|
|
setFlag(QGraphicsItem::ItemHasNoContents, false);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
DeclarativeChart::DeclarativeChart(QQuickItem *parent)
|
|
|
|
: QQuickPaintedItem(parent)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-01-03 15:29:22 +00:00
|
|
|
#ifndef QTQUICK2
|
2012-01-03 14:22:10 +00:00
|
|
|
void DeclarativeChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
|
|
|
#else
|
|
|
|
void DeclarativeChart::paint(QPainter *painter)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
drawChart(painter, boundingRect());
|
|
|
|
}
|
|
|
|
|