From 10f778f664858012c41367d143f0622945a206fa 2012-09-17 10:23:17 From: Tero Ahola Date: 2012-09-17 10:23:17 Subject: [PATCH] Added opacity property to QAbstractSeries --- diff --git a/plugins/declarative/plugin.cpp b/plugins/declarative/plugin.cpp index 9ee067d..5867439 100644 --- a/plugins/declarative/plugin.cpp +++ b/plugins/declarative/plugin.cpp @@ -58,6 +58,7 @@ class ChartQmlPlugin : public QDeclarativeExtensionPlugin Q_OBJECT #ifdef QT5_QUICK_1 + // TODO: fix the metadata Q_PLUGIN_METADATA(IID "org.qt-project.foo") #endif diff --git a/src/areachart/areachartitem.cpp b/src/areachart/areachartitem.cpp index 9b8783b..e18abd2 100644 --- a/src/areachart/areachartitem.cpp +++ b/src/areachart/areachartitem.cpp @@ -48,6 +48,7 @@ AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, ChartPresenter *presenter) QObject::connect(m_series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); + QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); QObject::connect(this,SIGNAL(clicked(QPointF)),areaSeries,SIGNAL(clicked(QPointF))); handleUpdated(); @@ -98,6 +99,7 @@ void AreaChartItem::handleUpdated() m_brush = m_series->brush(); m_pointPen = m_series->pen(); m_pointPen.setWidthF(2 * m_pointPen.width()); + setOpacity(m_series->opacity()); update(); } diff --git a/src/barchart/abstractbarchartitem.cpp b/src/barchart/abstractbarchartitem.cpp index 55e1ad6..3686357 100644 --- a/src/barchart/abstractbarchartitem.cpp +++ b/src/barchart/abstractbarchartitem.cpp @@ -45,6 +45,7 @@ AbstractBarChartItem::AbstractBarChartItem(QAbstractBarSeries *series, ChartPres connect(series->d_func(), SIGNAL(labelsVisibleChanged(bool)), this, SLOT(handleLabelsVisibleChanged(bool))); connect(series->d_func(), SIGNAL(restructuredBars()), this, SLOT(handleDataStructureChanged())); connect(series, SIGNAL(visibleChanged()), this, SLOT(handleVisibleChanged())); + connect(series, SIGNAL(opacityChanged()), this, SLOT(handleOpacityChanged())); setZValue(ChartPresenter::BarSeriesZValue); handleDataStructureChanged(); } @@ -170,9 +171,14 @@ void AbstractBarChartItem::handleVisibleChanged() { bool visible = m_series->isVisible(); handleLabelsVisibleChanged(visible); - foreach(QGraphicsItem *item, childItems()) { + foreach(QGraphicsItem *item, childItems()) item->setVisible(visible); - } +} + +void AbstractBarChartItem::handleOpacityChanged() +{ + foreach(QGraphicsItem *item, childItems()) + item->setOpacity(m_series->opacity()); } void AbstractBarChartItem::handleUpdatedBars() diff --git a/src/barchart/abstractbarchartitem_p.h b/src/barchart/abstractbarchartitem_p.h index ed03674..a253cfb 100644 --- a/src/barchart/abstractbarchartitem_p.h +++ b/src/barchart/abstractbarchartitem_p.h @@ -68,6 +68,7 @@ public Q_SLOTS: void handleLabelsVisibleChanged(bool visible); void handleDataStructureChanged(); // structure of of series has changed, recreate graphic items void handleVisibleChanged(); + void handleOpacityChanged(); void handleUpdatedBars(); protected: diff --git a/src/linechart/linechartitem.cpp b/src/linechart/linechartitem.cpp index e06b9a1..629f1df 100644 --- a/src/linechart/linechartitem.cpp +++ b/src/linechart/linechartitem.cpp @@ -38,6 +38,7 @@ LineChartItem::LineChartItem(QLineSeries* series,ChartPresenter *presenter): setZValue(ChartPresenter::LineChartZValue); QObject::connect(series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); + QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); handleUpdated(); } @@ -103,6 +104,7 @@ void LineChartItem::updateGeometry() void LineChartItem::handleUpdated() { setVisible(m_series->isVisible()); + setOpacity(m_series->opacity()); m_pointsVisible = m_series->pointsVisible(); m_linePen = m_series->pen(); update(); diff --git a/src/piechart/piechartitem.cpp b/src/piechart/piechartitem.cpp index 0d70d4c..f980a9a 100644 --- a/src/piechart/piechartitem.cpp +++ b/src/piechart/piechartitem.cpp @@ -41,6 +41,7 @@ PieChartItem::PieChartItem(QPieSeries *series, ChartPresenter* presenter) QPieSeriesPrivate *p = QPieSeriesPrivate::fromSeries(series); connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged())); + connect(series, SIGNAL(opacityChanged()), this, SLOT(handleOpacityChanged())); connect(series, SIGNAL(added(QList)), this, SLOT(handleSlicesAdded(QList))); connect(series, SIGNAL(removed(QList)), this, SLOT(handleSlicesRemoved(QList))); connect(p, SIGNAL(horizontalPositionChanged()), this, SLOT(updateLayout())); @@ -228,6 +229,11 @@ void PieChartItem::handleSeriesVisibleChanged() setVisible(m_series->isVisible()); } +void PieChartItem::handleOpacityChanged() +{ + setOpacity(m_series->opacity()); +} + PieSliceData PieChartItem::updateSliceGeometry(QPieSlice *slice) { PieSliceData &sliceData = QPieSlicePrivate::fromSlice(slice)->m_data; diff --git a/src/piechart/piechartitem_p.h b/src/piechart/piechartitem_p.h index 89b9f6d..e6af3eb 100644 --- a/src/piechart/piechartitem_p.h +++ b/src/piechart/piechartitem_p.h @@ -65,6 +65,7 @@ public Q_SLOTS: void handleSlicesRemoved(QList slices); void handleSliceChanged(); void handleSeriesVisibleChanged(); + void handleOpacityChanged(); void setAnimation(PieAnimation* animation); ChartAnimation* animation() const; diff --git a/src/qabstractseries.cpp b/src/qabstractseries.cpp index d26fb8f..bc4fc8f 100644 --- a/src/qabstractseries.cpp +++ b/src/qabstractseries.cpp @@ -151,6 +151,19 @@ bool QAbstractSeries::isVisible() const return d_ptr->m_visible; } +qreal QAbstractSeries::opacity() const +{ + return d_ptr->m_opacity; +} + +void QAbstractSeries::setOpacity(qreal opacity) +{ + if (opacity != d_ptr->m_opacity) { + d_ptr->m_opacity = opacity; + emit opacityChanged(); + } +} + /*! \brief Returns the chart where series belongs to. @@ -193,7 +206,8 @@ QAbstractSeriesPrivate::QAbstractSeriesPrivate(QAbstractSeries* q): q_ptr(q), m_chart(0), m_dataset(0), - m_visible(true) + m_visible(true), + m_opacity(1.0) { } diff --git a/src/qabstractseries.h b/src/qabstractseries.h index d2fca74..ca6fe44 100644 --- a/src/qabstractseries.h +++ b/src/qabstractseries.h @@ -36,6 +36,7 @@ class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) Q_PROPERTY(SeriesType type READ type) Q_ENUMS(SeriesType) @@ -65,6 +66,9 @@ public: QString name() const; void setVisible(bool visible = true); bool isVisible() const; + qreal opacity() const; + void setOpacity(qreal opacity); + QChart* chart() const; void show(); @@ -73,6 +77,7 @@ public: Q_SIGNALS: void nameChanged(); void visibleChanged(); + void opacityChanged(); protected: QScopedPointer d_ptr; diff --git a/src/qabstractseries_p.h b/src/qabstractseries_p.h index 262fed4..583c299 100644 --- a/src/qabstractseries_p.h +++ b/src/qabstractseries_p.h @@ -61,6 +61,7 @@ protected: ChartDataSet *m_dataset; QString m_name; bool m_visible; + qreal m_opacity; friend class QAbstractSeries; friend class ChartDataSet; diff --git a/src/scatterchart/scatterchartitem.cpp b/src/scatterchart/scatterchartitem.cpp index b2535be..7de66de 100644 --- a/src/scatterchart/scatterchartitem.cpp +++ b/src/scatterchart/scatterchartitem.cpp @@ -40,6 +40,7 @@ ScatterChartItem::ScatterChartItem(QScatterSeries *series, ChartPresenter *prese { QObject::connect(m_series->d_func(),SIGNAL(updated()), this, SLOT(handleUpdated())); QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); + QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); setZValue(ChartPresenter::ScatterSeriesZValue); setFlags(QGraphicsItem::ItemClipsChildrenToShape); @@ -174,6 +175,7 @@ void ScatterChartItem::handleUpdated() m_visible = m_series->isVisible(); m_size = m_series->markerSize(); m_shape = m_series->markerShape(); + setOpacity(m_series->opacity()); if(recreate) { // TODO: optimize handleUpdate to recreate points only in case shape changed diff --git a/src/splinechart/splinechartitem.cpp b/src/splinechart/splinechartitem.cpp index 9b26a62..7cf4e19 100644 --- a/src/splinechart/splinechartitem.cpp +++ b/src/splinechart/splinechartitem.cpp @@ -37,6 +37,7 @@ SplineChartItem::SplineChartItem(QSplineSeries *series, ChartPresenter *presente setZValue(ChartPresenter::SplineChartZValue); QObject::connect(m_series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); + QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); handleUpdated(); } @@ -135,6 +136,7 @@ void SplineChartItem::updateGeometry() void SplineChartItem::handleUpdated() { setVisible(m_series->isVisible()); + setOpacity(m_series->opacity()); m_pointsVisible = m_series->pointsVisible(); m_linePen = m_series->pen(); m_pointPen = m_series->pen(); diff --git a/tests/auto/qbarseries/tst_qbarseries.cpp b/tests/auto/qbarseries/tst_qbarseries.cpp index 586b008..823d96f 100644 --- a/tests/auto/qbarseries/tst_qbarseries.cpp +++ b/tests/auto/qbarseries/tst_qbarseries.cpp @@ -59,6 +59,7 @@ private slots: void barSets(); void setLabelsVisible_data(); void setLabelsVisible(); + void opacity(); void mouseclicked_data(); void mouseclicked(); void mousehovered_data(); @@ -342,6 +343,25 @@ void tst_QBarSeries::setLabelsVisible() QVERIFY(m_barseries_with_sets->isLabelsVisible() == true); } +void tst_QBarSeries::opacity() +{ + QSignalSpy opacitySpy(m_barseries, SIGNAL(opacityChanged())); + + QCOMPARE(m_barseries->opacity(), 1.0); + + m_barseries->setOpacity(0.5); + QCOMPARE(m_barseries->opacity(), 0.5); + QCOMPARE(opacitySpy.count(), 1); + + m_barseries->setOpacity(0.0); + QCOMPARE(m_barseries->opacity(), 0.0); + QCOMPARE(opacitySpy.count(), 2); + + m_barseries->setOpacity(1.0); + QCOMPARE(m_barseries->opacity(), 1.0); + QCOMPARE(opacitySpy.count(), 3); +} + void tst_QBarSeries::mouseclicked_data() { diff --git a/tests/auto/qpieseries/tst_qpieseries.cpp b/tests/auto/qpieseries/tst_qpieseries.cpp index 5a446c8..0804642 100644 --- a/tests/auto/qpieseries/tst_qpieseries.cpp +++ b/tests/auto/qpieseries/tst_qpieseries.cpp @@ -97,6 +97,7 @@ void tst_qpieseries::properties() { QSignalSpy countSpy(m_series, SIGNAL(countChanged())); QSignalSpy sumSpy(m_series, SIGNAL(sumChanged())); + QSignalSpy opacitySpy(m_series, SIGNAL(opacityChanged())); QVERIFY(m_series->type() == QAbstractSeries::SeriesTypePie); QVERIFY(m_series->count() == 0); @@ -107,6 +108,7 @@ void tst_qpieseries::properties() QCOMPARE(m_series->pieSize(), 0.7); QCOMPARE(m_series->pieStartAngle(), 0.0); QCOMPARE(m_series->pieEndAngle(), 360.0); + QCOMPARE(m_series->opacity(), 1.0); m_series->append("s1", 1); m_series->append("s2", 1); @@ -167,6 +169,16 @@ void tst_qpieseries::properties() m_series->setVerticalPosition(1.0); m_series->setVerticalPosition(2.0); QCOMPARE(m_series->verticalPosition(), 1.0); + + m_series->setOpacity(0.5); + QCOMPARE(m_series->opacity(), 0.5); + QCOMPARE(opacitySpy.count(), 1); + m_series->setOpacity(0.0); + QCOMPARE(m_series->opacity(), 0.0); + QCOMPARE(opacitySpy.count(), 2); + m_series->setOpacity(1.0); + QCOMPARE(m_series->opacity(), 1.0); + QCOMPARE(opacitySpy.count(), 3); } void tst_qpieseries::append() diff --git a/tests/auto/qxyseries/tst_qxyseries.cpp b/tests/auto/qxyseries/tst_qxyseries.cpp index 0cfd891..ac044ee 100644 --- a/tests/auto/qxyseries/tst_qxyseries.cpp +++ b/tests/auto/qxyseries/tst_qxyseries.cpp @@ -63,6 +63,24 @@ void tst_QXYSeries::seriesVisible() TRY_COMPARE(visibleSpy.count(), 2); } +void tst_QXYSeries::seriesOpacity() +{ + QSignalSpy opacitySpy(m_series, SIGNAL(opacityChanged())); + QCOMPARE(m_series->opacity(), 1.0); + + m_series->setOpacity(0.5); + QCOMPARE(m_series->opacity(), 0.5); + QCOMPARE(opacitySpy.count(), 1); + + m_series->setOpacity(0.0); + QCOMPARE(m_series->opacity(), 0.0); + QCOMPARE(opacitySpy.count(), 2); + + m_series->setOpacity(1.0); + QCOMPARE(m_series->opacity(), 1.0); + QCOMPARE(opacitySpy.count(), 3); +} + void tst_QXYSeries::append_data() { QTest::addColumn< QList >("points"); diff --git a/tests/auto/qxyseries/tst_qxyseries.h b/tests/auto/qxyseries/tst_qxyseries.h index f05a054..8922f53 100644 --- a/tests/auto/qxyseries/tst_qxyseries.h +++ b/tests/auto/qxyseries/tst_qxyseries.h @@ -42,6 +42,7 @@ public slots: private slots: void seriesName(); void seriesVisible(); + void seriesOpacity(); void oper_data(); void oper(); void pen_data(); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml index 9fa4b08..bdb80c2 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml @@ -63,6 +63,7 @@ ChartView { onNameChanged: console.log(name + ".onNameChanged: " + name); onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible); + onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); onSelected: console.log(name + ".onSelected"); onColorChanged: console.log(name + ".onColorChanged: " + color); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml b/tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml index 70b0913..baa812b 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml @@ -31,6 +31,14 @@ Flow { onClicked: series.visible = !series.visible; } Button { + text: "opacity +" + onClicked: series.opacity += 0.1; + } + Button { + text: "opacity -" + onClicked: series.opacity -= 0.1; + } + Button { text: "color" onClicked: series.color = main.nextColor(); } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml index ce6c14e..06e5ac3 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml @@ -54,11 +54,12 @@ ChartView { BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name); - onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible); - onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index); - onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status); - onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); - onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count); + onNameChanged: console.log("barSeries.onNameChanged: " + series.name); + onVisibleChanged: console.log("barSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("barSeries.onOpacityChanged: " + opacity); + onClicked: console.log("barSeries.onClicked: " + barset + " " + index); + onHovered: console.log("barSeries.onHovered: " + barset + " " + status); + onLabelsVisibleChanged: console.log("barSeries.onLabelsVisibleChanged: " + series.labelsVisible); + onCountChanged: console.log("barSeries.onCountChanged: " + count); } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml b/tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml index 15d68c5..7f849b5 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml @@ -82,6 +82,14 @@ Row { onClicked: series.visible = !series.visible; } Button { + text: "opacity +" + onClicked: series.opacity += 0.1; + } + Button { + text: "opacity -" + onClicked: series.opacity -= 0.1; + } + Button { text: "bar width +" onClicked: series.barWidth += 0.1; } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml index 561a8cd..3d9f92c 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml @@ -53,11 +53,12 @@ ChartView { BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name); - onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible); - onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index); - onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status); - onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); - onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count); + onNameChanged: console.log("horizontalBarSeries.onNameChanged: " + series.name); + onVisibleChanged: console.log("horizontalBarSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("horizontalBarSeries.onOpacityChanged: " + opacity); + onClicked: console.log("horizontalBarSeries.onClicked: " + barset + " " + index); + onHovered: console.log("horizontalBarSeries.onHovered: " + barset + " " + status); + onLabelsVisibleChanged: console.log("horizontalBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); + onCountChanged: console.log("horizontalBarSeries.onCountChanged: " + count); } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml index c93fa91..96fbef9 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml @@ -53,11 +53,12 @@ ChartView { BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name); - onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible); - onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index); - onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status); - onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); - onCountChanged: console.log("percentBarSeries.onCountChanged: " + count); + onNameChanged: console.log("horizontalPercentBarSeries.onNameChanged: " + series.name); + onVisibleChanged: console.log("horizontalPercentBarSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("horizontalPercentBarSeries.onOpacityChanged: " + opacity); + onClicked: console.log("horizontalPercentBarSeries.onClicked: " + barset + " " + index); + onHovered: console.log("horizontalPercentBarSeries.onHovered: " + barset + " " + status); + onLabelsVisibleChanged: console.log("horizontalPercentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); + onCountChanged: console.log("horizontalPercentBarSeries.onCountChanged: " + count); } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml index cfc858c..89f147e 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml @@ -53,11 +53,12 @@ ChartView { BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name); - onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible); - onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index); - onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status); - onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); - onCountChanged: console.log("stackedBarSeries.onCountChanged: " + count); + onNameChanged: console.log("horizontalStackedBarSeries.onNameChanged: " + series.name); + onVisibleChanged: console.log("horizontalStackedBarSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("horizontalStackedBarSeries.onOpacityChanged: " + opacity); + onClicked: console.log("horizontalStackedBarSeries.onClicked: " + barset + " " + index); + onHovered: console.log("horizontalStackedBarSeries.onHovered: " + barset + " " + status); + onLabelsVisibleChanged: console.log("horizontalStackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); + onCountChanged: console.log("horizontalStackedBarSeries.onCountChanged: " + count); } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml index 2171708..698451d 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml @@ -41,6 +41,7 @@ ChartView { onNameChanged: console.log("lineSeries.onNameChanged: " + name); onVisibleChanged: console.log("lineSeries.onVisibleChanged: " + visible); + onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); onPointReplaced: console.log("lineSeries.onPointReplaced: " + index); onPointRemoved: console.log("lineSeries.onPointRemoved: " + index); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml b/tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml index da18917..6377584 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml @@ -32,6 +32,14 @@ Flow { onClicked: series.visible = !series.visible; } Button { + text: "opacity +" + onClicked: series.opacity += 0.1; + } + Button { + text: "opacity -" + onClicked: series.opacity -= 0.1; + } + Button { text: "color" onClicked: series.color = main.nextColor(); } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml index 39509d5..9fb5259 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml @@ -56,6 +56,7 @@ ChartView { onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name); onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("percentBarSeries.onOpacityChanged: " + opacity); onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index); onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status); onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml index 2ba116b..b5e01bb 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml @@ -52,15 +52,16 @@ ChartView { PieSlice { label: "slice3"; value: 33 } PieSlice { label: "slice4"; value: 44 } - onNameChanged: console.log("pieSeries.onNameChanged: " + series.name); + onNameChanged: console.log("pieSeries.onNameChanged: " + name); onVisibleChanged: console.log("pieSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("pieSeries.onOpacityChanged: " + opacity); onClicked: console.log("pieSeries.onClicked: " + slice.label); onHovered: console.log("pieSeries.onHovered: " + slice.label); onAdded: console.log("pieSeries.onAdded: " + slices); onSliceAdded: console.log("pieSeries.onSliceAdded: " + slice.label); onRemoved: console.log("pieSeries.onRemoved: " + slices); onSliceRemoved: console.log("pieSeries.onSliceRemoved: " + slice.label); - onCountChanged: console.log("pieSeries.onCountChanged: " + series.count); - onSumChanged: console.log("pieSeries.onSumChanged: " + series.sum); + onCountChanged: console.log("pieSeries.onCountChanged: " + count); + onSumChanged: console.log("pieSeries.onSumChanged: " + sum); } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml b/tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml index 1fe06e8..5c1ebde 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml @@ -83,6 +83,14 @@ Row { onClicked: series.visible = !series.visible; } Button { + text: "series opacity +" + onClicked: series.opacity += 0.1; + } + Button { + text: "series opacity -" + onClicked: series.opacity -= 0.1; + } + Button { text: "series hpos +" onClicked: series.horizontalPosition += 0.1; } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml index 8f3f5e3..9dcfb83 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml @@ -39,6 +39,7 @@ ChartView { onNameChanged: console.log("scatterSeries.onNameChanged: " + name); onVisibleChanged: console.log("scatterSeries.onVisibleChanged: " + visible); + onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); onPointReplaced: console.log("scatterSeries.onPointReplaced: " + index); onPointRemoved: console.log("scatterSeries.onPointRemoved: " + index); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml b/tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml index e4b4160..f594c6f 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml @@ -31,6 +31,14 @@ Flow { onClicked: series.visible = !series.visible; } Button { + text: "opacity +" + onClicked: series.opacity += 0.1; + } + Button { + text: "opacity -" + onClicked: series.opacity -= 0.1; + } + Button { text: "color" onClicked: series.color = main.nextColor(); } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml index 13af6af..a05cf08 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml @@ -40,6 +40,7 @@ ChartView { onNameChanged: console.log("splineSeries.onNameChanged: " + name); onVisibleChanged: console.log("splineSeries.onVisibleChanged: " + visible); + onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); onPointReplaced: console.log("splineSeries.onPointReplaced: " + index); onPointRemoved: console.log("splineSeries.onPointRemoved: " + index); diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml index e2e1d9b..0886f2a 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml @@ -55,6 +55,7 @@ ChartView { onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name); onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible); + onOpacityChanged: console.log("stackedBarSeries.onOpacityChanged: " + opacity); onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index); onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status); onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);