@@ -50,7 +50,7 void DeclarativeBoxSet::setValues(QVariantList values) | |||||
50 |
|
50 | |||
51 | // ===================================================== |
|
51 | // ===================================================== | |
52 |
|
52 | |||
53 |
DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QD |
|
53 | DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent) : | |
54 | QBoxPlotSeries(parent), |
|
54 | QBoxPlotSeries(parent), | |
55 | m_axes(new DeclarativeAxes(this)) |
|
55 | m_axes(new DeclarativeAxes(this)) | |
56 | { |
|
56 | { | |
@@ -78,12 +78,12 void DeclarativeBoxPlotSeries::componentComplete() | |||||
78 | } |
|
78 | } | |
79 | } |
|
79 | } | |
80 |
|
80 | |||
81 |
QD |
|
81 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeBoxPlotSeries::seriesChildren() | |
82 | { |
|
82 | { | |
83 |
return QD |
|
83 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
84 | } |
|
84 | } | |
85 |
|
85 | |||
86 |
void DeclarativeBoxPlotSeries::appendSeriesChildren(QD |
|
86 | void DeclarativeBoxPlotSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) | |
87 | { |
|
87 | { | |
88 | // Empty implementation; the children are parsed in componentComplete instead |
|
88 | // Empty implementation; the children are parsed in componentComplete instead | |
89 | Q_UNUSED(list); |
|
89 | Q_UNUSED(list); |
@@ -24,8 +24,13 | |||||
24 | #include "qboxset.h" |
|
24 | #include "qboxset.h" | |
25 | #include "declarativeaxes.h" |
|
25 | #include "declarativeaxes.h" | |
26 | #include "qboxplotseries.h" |
|
26 | #include "qboxplotseries.h" | |
|
27 | #ifdef CHARTS_FOR_QUICK2 | |||
|
28 | #include <QtQuick/QQuickItem> | |||
|
29 | #include <QtQml/QQmlParserStatus> | |||
|
30 | #else | |||
27 | #include <QtDeclarative/QDeclarativeItem> |
|
31 | #include <QtDeclarative/QDeclarativeItem> | |
28 | #include <QtDeclarative/QDeclarativeParserStatus> |
|
32 | #include <QtDeclarative/QDeclarativeParserStatus> | |
|
33 | #endif | |||
29 |
|
34 | |||
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
31 |
|
36 | |||
@@ -62,19 +67,27 Q_SIGNALS: | |||||
62 | void changedValue(int index); |
|
67 | void changedValue(int index); | |
63 | }; |
|
68 | }; | |
64 |
|
69 | |||
65 |
class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QD |
|
70 | class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDECLARATIVE_PARSER_STATUS | |
66 | { |
|
71 | { | |
67 | Q_OBJECT |
|
72 | Q_OBJECT | |
|
73 | #ifdef CHARTS_FOR_QUICK2 | |||
|
74 | Q_INTERFACES(QQmlParserStatus) | |||
|
75 | #else | |||
68 | Q_INTERFACES(QDeclarativeParserStatus) |
|
76 | Q_INTERFACES(QDeclarativeParserStatus) | |
|
77 | #endif | |||
69 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) |
|
78 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) | |
70 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) |
|
79 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) | |
71 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged) |
|
80 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged) | |
72 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged) |
|
81 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged) | |
|
82 | #ifdef CHARTS_FOR_QUICK2 | |||
|
83 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |||
|
84 | #else | |||
73 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
85 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
|
86 | #endif | |||
74 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
87 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
75 |
|
88 | |||
76 | public: |
|
89 | public: | |
77 |
explicit DeclarativeBoxPlotSeries(QD |
|
90 | explicit DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent = 0); | |
78 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
91 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
79 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
92 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
80 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
93 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
@@ -83,7 +96,7 public: | |||||
83 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
96 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
84 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
97 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
85 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
98 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
86 |
QD |
|
99 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
87 |
|
100 | |||
88 | public: |
|
101 | public: | |
89 | Q_INVOKABLE DeclarativeBoxSet *at(int index); |
|
102 | Q_INVOKABLE DeclarativeBoxSet *at(int index); | |
@@ -106,7 +119,7 Q_SIGNALS: | |||||
106 | void hovered(bool status, DeclarativeBoxSet *boxset); |
|
119 | void hovered(bool status, DeclarativeBoxSet *boxset); | |
107 |
|
120 | |||
108 | public Q_SLOTS: |
|
121 | public Q_SLOTS: | |
109 |
static void appendSeriesChildren(QD |
|
122 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
110 | void onHovered(bool status, QBoxSet *boxset); |
|
123 | void onHovered(bool status, QBoxSet *boxset); | |
111 | void onClicked(QBoxSet *boxset); |
|
124 | void onClicked(QBoxSet *boxset); | |
112 |
|
125 |
General Comments 0
You need to be logged in to leave comments.
Login now