diff --git a/plugins/declarative/declarativeboxplotseries.cpp b/plugins/declarative/declarativeboxplotseries.cpp index 64507ef..ffb4526 100644 --- a/plugins/declarative/declarativeboxplotseries.cpp +++ b/plugins/declarative/declarativeboxplotseries.cpp @@ -50,7 +50,7 @@ void DeclarativeBoxSet::setValues(QVariantList values) // ===================================================== -DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDeclarativeItem *parent) : +DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent) : QBoxPlotSeries(parent), m_axes(new DeclarativeAxes(this)) { @@ -78,12 +78,12 @@ void DeclarativeBoxPlotSeries::componentComplete() } } -QDeclarativeListProperty DeclarativeBoxPlotSeries::seriesChildren() +QDECLARATIVE_LIST_PROPERTY DeclarativeBoxPlotSeries::seriesChildren() { - return QDeclarativeListProperty(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren); + return QDECLARATIVE_LIST_PROPERTY(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); } -void DeclarativeBoxPlotSeries::appendSeriesChildren(QDeclarativeListProperty *list, QObject *element) +void DeclarativeBoxPlotSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY *list, QObject *element) { // Empty implementation; the children are parsed in componentComplete instead Q_UNUSED(list); diff --git a/plugins/declarative/declarativeboxplotseries.h b/plugins/declarative/declarativeboxplotseries.h index 4822b71..26336ff 100644 --- a/plugins/declarative/declarativeboxplotseries.h +++ b/plugins/declarative/declarativeboxplotseries.h @@ -24,8 +24,13 @@ #include "qboxset.h" #include "declarativeaxes.h" #include "qboxplotseries.h" +#ifdef CHARTS_FOR_QUICK2 +#include +#include +#else #include #include +#endif QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -62,19 +67,27 @@ Q_SIGNALS: void changedValue(int index); }; -class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDeclarativeParserStatus +class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDECLARATIVE_PARSER_STATUS { Q_OBJECT +#ifdef CHARTS_FOR_QUICK2 + Q_INTERFACES(QQmlParserStatus) +#else Q_INTERFACES(QDeclarativeParserStatus) +#endif Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged) Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged) +#ifdef CHARTS_FOR_QUICK2 + Q_PROPERTY(QQmlListProperty seriesChildren READ seriesChildren) +#else Q_PROPERTY(QDeclarativeListProperty seriesChildren READ seriesChildren) +#endif Q_CLASSINFO("DefaultProperty", "seriesChildren") public: - explicit DeclarativeBoxPlotSeries(QDeclarativeItem *parent = 0); + explicit DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent = 0); QAbstractAxis *axisX() { return m_axes->axisX(); } void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } QAbstractAxis *axisY() { return m_axes->axisY(); } @@ -83,7 +96,7 @@ public: void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } - QDeclarativeListProperty seriesChildren(); + QDECLARATIVE_LIST_PROPERTY seriesChildren(); public: Q_INVOKABLE DeclarativeBoxSet *at(int index); @@ -106,7 +119,7 @@ Q_SIGNALS: void hovered(bool status, DeclarativeBoxSet *boxset); public Q_SLOTS: - static void appendSeriesChildren(QDeclarativeListProperty *list, QObject *element); + static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY *list, QObject *element); void onHovered(bool status, QBoxSet *boxset); void onClicked(QBoxSet *boxset);