2012-01-03 14:22:10 +00:00
|
|
|
#include "declarativechart.h"
|
|
|
|
|
2012-02-02 16:42:44 +00:00
|
|
|
QTCOMMERCIALCHART_BEGIN_NAMESPACE
|
|
|
|
|
2012-01-03 14:22:10 +00:00
|
|
|
DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent)
|
2012-02-02 16:42:44 +00:00
|
|
|
: QDeclarativeItem(parent),
|
|
|
|
m_chart(new QChart(this))
|
2012-01-03 14:22:10 +00:00
|
|
|
{
|
|
|
|
setFlag(QGraphicsItem::ItemHasNoContents, false);
|
|
|
|
}
|
|
|
|
|
2012-02-02 16:42:44 +00:00
|
|
|
DeclarativeChart::ChartTheme DeclarativeChart::theme()
|
|
|
|
{
|
2012-02-24 09:33:17 +00:00
|
|
|
return (ChartTheme) m_chart->chartTheme();
|
2012-01-03 14:22:10 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 16:42:44 +00:00
|
|
|
void DeclarativeChart::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
|
2012-01-03 14:22:10 +00:00
|
|
|
{
|
2012-02-17 09:03:26 +00:00
|
|
|
if (newGeometry.isValid()) {
|
|
|
|
if (newGeometry.width() > 0 && newGeometry.height() > 0) {
|
2012-03-19 10:01:31 +00:00
|
|
|
m_chart->resize(newGeometry.width(), newGeometry.height());
|
2012-02-17 09:03:26 +00:00
|
|
|
}
|
|
|
|
}
|
2012-01-03 14:22:10 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 16:42:44 +00:00
|
|
|
#include "moc_declarativechart.cpp"
|
|
|
|
|
|
|
|
QTCOMMERCIALCHART_END_NAMESPACE
|