##// END OF EJS Templates
Add invokable clear() for QML bar category axis...
Titta Heikkala -
r2691:0f386f5dd654
parent child
Show More
@@ -22,7 +22,8 headers.fileextensions = *.h *.ch *.h++ *.hh *.hpp *.hxx
22 examples.fileextensions = *.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml
22 examples.fileextensions = *.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml
23 examples.imageextensions = *.png *.jpeg *.jpg *.gif *.mng
23 examples.imageextensions = *.png *.jpeg *.jpg *.gif *.mng
24
24
25 Cpp.ignoretokens = QTCOMMERCIALCHART_EXPORT \
25 Cpp.ignoretokens = Q_INVOKABLE \
26 QTCOMMERCIALCHART_EXPORT \
26 QTCOMMERCIALCHART_END_NAMESPACE \
27 QTCOMMERCIALCHART_END_NAMESPACE \
27 QTCOMMERCIALCHART_BEGIN_NAMESPACE
28 QTCOMMERCIALCHART_BEGIN_NAMESPACE
28 Cpp.ignoredirectives = Q_DECLARE_HANDLE \
29 Cpp.ignoredirectives = Q_DECLARE_HANDLE \
@@ -1706,6 +1706,7 Module {
1706 Parameter { name: "min"; type: "string" }
1706 Parameter { name: "min"; type: "string" }
1707 Parameter { name: "max"; type: "string" }
1707 Parameter { name: "max"; type: "string" }
1708 }
1708 }
1709 Method { name: "clear" }
1709 }
1710 }
1710 Component {
1711 Component {
1711 name: "QtCommercialChart::QBarModelMapper"
1712 name: "QtCommercialChart::QBarModelMapper"
@@ -33,7 +33,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
33 \brief The QBarCategoryAxis class is used for manipulating chart's axis.
33 \brief The QBarCategoryAxis class is used for manipulating chart's axis.
34 \mainclass
34 \mainclass
35
35
36 BarCategoryAxis can be setup to show axis line with tick marks, grid lines and shades.
36 QBarCategoryAxis can be setup to show axis line with tick marks, grid lines and shades.
37 Categories are drawn between ticks. Note that you can use this also with lineseries too.
37 Categories are drawn between ticks. Note that you can use this also with lineseries too.
38 See the \l {Line and BarChart Example} {Line and BarChart Example} to learn how to do that.
38 See the \l {Line and BarChart Example} {Line and BarChart Example} to learn how to do that.
39
39
@@ -144,6 +144,11 QTCOMMERCIALCHART_BEGIN_NAMESPACE
144 */
144 */
145
145
146 /*!
146 /*!
147 \qmlmethod void BarCategoryAxis::clear()
148 Removes all categories. Sets the maximum and minimum of the axis's range to QString::null.
149 */
150
151 /*!
147 Constructs an axis object which is a child of \a parent.
152 Constructs an axis object which is a child of \a parent.
148 */
153 */
149 QBarCategoryAxis::QBarCategoryAxis(QObject *parent):
154 QBarCategoryAxis::QBarCategoryAxis(QObject *parent):
@@ -49,7 +49,7 public:
49 void remove(const QString &category);
49 void remove(const QString &category);
50 void insert(int index, const QString &category);
50 void insert(int index, const QString &category);
51 void replace(const QString &oldCategory, const QString &newCategory);
51 void replace(const QString &oldCategory, const QString &newCategory);
52 void clear();
52 Q_INVOKABLE void clear();
53 void setCategories(const QStringList &categories);
53 void setCategories(const QStringList &categories);
54 QStringList categories();
54 QStringList categories();
55 int count() const;
55 int count() const;
@@ -64,6 +64,17 Rectangle {
64 compare(minChangedSpy.count, 1, "onMinChanged");
64 compare(minChangedSpy.count, 1, "onMinChanged");
65 compare(maxChangedSpy.count, 1, "onMaxChanged");
65 compare(maxChangedSpy.count, 1, "onMaxChanged");
66 }
66 }
67
68 function test_seriesAxisClear() {
69 verify(barSeries1.axisX.min !== "", "barSeries1.axisX.min");
70 verify(barSeries1.axisX.max !== "", "barSeries1.axisX.max");
71 verify(barSeries1.axisX.count !== 0, "barSeries1.axisX.count"); // category count
72 barSeries1.axisX.clear();
73 verify(barSeries1.axisX.min === "", "barSeries1.axisX.min");
74 verify(barSeries1.axisX.max === "", "barSeries1.axisX.max");
75 verify(barSeries1.axisX.count === 0);
76 }
77
67 }
78 }
68
79
69 ChartView {
80 ChartView {
General Comments 0
You need to be logged in to leave comments. Login now