diff --git a/src/barchart/barchartseries.cpp b/src/barchart/barchartseries.cpp index 3dc1a1b..b43afc7 100644 --- a/src/barchart/barchartseries.cpp +++ b/src/barchart/barchartseries.cpp @@ -11,6 +11,7 @@ BarChartSeries::BarChartSeries(QObject *parent) bool BarChartSeries::setData(QAbstractItemModel* model) { mModel = model; + return true; } int BarChartSeries::min() diff --git a/src/barchart/bargroup.cpp b/src/barchart/bargroup.cpp index 7b967aa..81e7f60 100644 --- a/src/barchart/bargroup.cpp +++ b/src/barchart/bargroup.cpp @@ -8,9 +8,9 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE BarGroup::BarGroup(BarChartSeries& series, QGraphicsItem *parent) : ChartItem(parent) ,mSeries(series) + ,mBarDefaultWidth(10) ,mLayoutSet(false) ,mLayoutDirty(true) - ,mBarDefaultWidth(10) { dataChanged(); } diff --git a/src/barchart/percentbarchartseries.cpp b/src/barchart/percentbarchartseries.cpp index a373939..880ad90 100644 --- a/src/barchart/percentbarchartseries.cpp +++ b/src/barchart/percentbarchartseries.cpp @@ -14,6 +14,7 @@ PercentBarChartSeries::PercentBarChartSeries(QObject *parent) : bool PercentBarChartSeries::setData(QAbstractItemModel* model) { mModel = model; + return true; } int PercentBarChartSeries::min() diff --git a/src/barchart/percentbargroup.cpp b/src/barchart/percentbargroup.cpp index fd89f97..76e9b79 100644 --- a/src/barchart/percentbargroup.cpp +++ b/src/barchart/percentbargroup.cpp @@ -6,11 +6,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE PercentBarGroup::PercentBarGroup(PercentBarChartSeries& series, QGraphicsItem *parent) : - ChartItem(parent) - ,mSeries(series) - ,mLayoutSet(false) - ,mLayoutDirty(true) - ,mBarDefaultWidth(20) // TODO: remove hard coding, when we have layout code ready + ChartItem(parent) + ,mSeries(series) + ,mBarDefaultWidth(20) // TODO: remove hard coding, when we have layout code ready + ,mLayoutSet(false) + ,mLayoutDirty(true) { dataChanged(); } diff --git a/src/barchart/stackedbarchartseries.cpp b/src/barchart/stackedbarchartseries.cpp index 405a4ba..548ec1b 100644 --- a/src/barchart/stackedbarchartseries.cpp +++ b/src/barchart/stackedbarchartseries.cpp @@ -12,6 +12,7 @@ StackedBarChartSeries::StackedBarChartSeries(QObject *parent) : bool StackedBarChartSeries::setData(QAbstractItemModel* model) { mModel = model; + return true; } int StackedBarChartSeries::min() diff --git a/src/barchart/stackedbargroup.cpp b/src/barchart/stackedbargroup.cpp index 2f9daa5..8924f52 100644 --- a/src/barchart/stackedbargroup.cpp +++ b/src/barchart/stackedbargroup.cpp @@ -7,13 +7,13 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE StackedBarGroup::StackedBarGroup(StackedBarChartSeries& series, QGraphicsItem *parent) : - ChartItem(parent) - ,mSeries(series) - ,mLayoutSet(false) - ,mLayoutDirty(true) - ,mBarDefaultWidth(20) // TODO: remove hard coding, when we have layout code ready - ,mTheme(0) - ,mSeparatorsVisible(true) + ChartItem(parent) + ,mSeries(series) + ,mBarDefaultWidth(20) // TODO: remove hard coding, when we have layout code ready + ,mLayoutSet(false) + ,mLayoutDirty(true) + ,mTheme(0) + ,mSeparatorsVisible(true) { dataChanged(); } diff --git a/src/qscatterseries.cpp b/src/qscatterseries.cpp index b00367f..be3a9e2 100644 --- a/src/qscatterseries.cpp +++ b/src/qscatterseries.cpp @@ -11,9 +11,9 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE QScatterSeriesPrivate::QScatterSeriesPrivate(QGraphicsItem *parent) : ChartItem(parent), + m_boundingRect(), m_markerColor(QColor()), - m_visibleChartArea(), - m_boundingRect() + m_visibleChartArea() { if (parent) m_boundingRect = parent->boundingRect(); diff --git a/test/qmlchart/chart.h b/test/qmlchart/chart.h deleted file mode 100644 index fa20070..0000000 --- a/test/qmlchart/chart.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef CHART_H -#define CHART_H - -#include -#include - -class Chart : public QDeclarativeItem -{ - Q_OBJECT - Q_PROPERTY(int theme READ theme WRITE setTheme NOTIFY themeChanged) - -public: - Chart(QDeclarativeItem *parent = 0) : - QDeclarativeItem(parent), m_theme(0) - { - setFlag(QGraphicsItem::ItemHasNoContents, false); - } - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) - { - // TODO: remove - QPen pen(QColor(0, 0, 0), 10); - painter->setPen(pen); - if(smooth() == true) { - painter->setRenderHint(QPainter::Antialiasing, true); - } - painter->drawLine(0, 0, 100, 100); - } - - int theme() const { return m_theme; } - - // Set methods - void setTheme(int theme) { - if (theme != m_theme) { - m_theme = theme; - updateSize(); - emit themeChanged(); - update(); - } - } - -signals: - void themeChanged(); - -private: - void updateSize() { -// setX(qMin(m_x1, m_x2) - m_penWidth/2); -// setY(qMin(m_y1, m_y2) - m_penWidth/2); -// setWidth(qAbs(m_x2 - m_x1) + m_penWidth); -// setHeight(qAbs(m_y2 - m_y1) + m_penWidth); - } - -private: - int m_theme; -}; - -QML_DECLARE_TYPE(Chart) - -#endif // CHART_H diff --git a/test/qmlchart/main.cpp b/test/qmlchart/main.cpp index 125111a..ac70a83 100644 --- a/test/qmlchart/main.cpp +++ b/test/qmlchart/main.cpp @@ -1,7 +1,6 @@ #include #include #include "qmlapplicationviewer.h" -#include "chart.h" Q_DECL_EXPORT int main(int argc, char *argv[]) {