From bae2376cbfec567c587e712bee6cefb06714b0c6 2012-05-24 06:47:45 From: Tero Ahola Date: 2012-05-24 06:47:45 Subject: [PATCH] Named all series in example applications --- diff --git a/demos/qmlweather/qml/qmlweather/main.qml b/demos/qmlweather/qml/qmlweather/main.qml index f4f614d..212984f 100644 --- a/demos/qmlweather/qml/qmlweather/main.qml +++ b/demos/qmlweather/qml/qmlweather/main.qml @@ -60,7 +60,7 @@ Rectangle { // A timer to refresh the forecast every 5 minutes Timer { - interval: 300000; + interval: 300000 repeat: true triggeredOnStart: true running: true diff --git a/examples/areachart/main.cpp b/examples/areachart/main.cpp index 2f7f3a2..0b86490 100644 --- a/examples/areachart/main.cpp +++ b/examples/areachart/main.cpp @@ -44,6 +44,7 @@ int main(int argc, char *argv[]) //![3] QAreaSeries* series = new QAreaSeries(series0, series1); + series->setName("Batman"); QPen pen(0x059605); pen.setWidth(3); series->setPen(pen); diff --git a/examples/customchart/main.cpp b/examples/customchart/main.cpp index 1f5e9b2..e7c8eb2 100644 --- a/examples/customchart/main.cpp +++ b/examples/customchart/main.cpp @@ -31,6 +31,7 @@ int main(int argc, char *argv[]) //![1] QLineSeries* series = new QLineSeries(); + series->setName("line"); *series << QPointF(0, 6) << QPointF(2, 4) << QPointF(3, 8) << QPointF(7, 4) << QPointF(10,5); QChart* chart = new QChart(); chart->addSeries(series); diff --git a/examples/linechart/main.cpp b/examples/linechart/main.cpp index 90d0a46..f9b4efc 100644 --- a/examples/linechart/main.cpp +++ b/examples/linechart/main.cpp @@ -31,6 +31,7 @@ int main(int argc, char *argv[]) //![1] QLineSeries* series = new QLineSeries(); + series->setName("line"); //![1] //![2] diff --git a/examples/modeldata/tablewidget.cpp b/examples/modeldata/tablewidget.cpp index 93d562d..cc57800 100644 --- a/examples/modeldata/tablewidget.cpp +++ b/examples/modeldata/tablewidget.cpp @@ -55,6 +55,7 @@ TableWidget::TableWidget(QWidget *parent) // series 1 //! [4] QLineSeries *series = new QLineSeries; + series->setName("line1"); series->setModel(model); QXYModelMapper *mapper = new QXYModelMapper; @@ -77,6 +78,7 @@ TableWidget::TableWidget(QWidget *parent) // series 2 //! [6] series = new QLineSeries; + series->setName("line2"); series->setModel(model); mapper = new QXYModelMapper; diff --git a/examples/presenterchart/chartview.cpp b/examples/presenterchart/chartview.cpp index b88613a..e07b9ff 100644 --- a/examples/presenterchart/chartview.cpp +++ b/examples/presenterchart/chartview.cpp @@ -35,22 +35,26 @@ m_index(-1),m_chart(chart) //![1] QLineSeries* series0 = new QLineSeries(); + series0->setName("line"); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); QScatterSeries* series1 = new QScatterSeries(); + series1->setName("scatter"); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); series1->setBrush(Qt::white); QSplineSeries* series2 = new QSplineSeries(); + series2->setName("spline"); QPen green(Qt::green); green.setWidth(3); series2->setPen(green); QAreaSeries* series3 = new QAreaSeries(series0); + series3->setName("area"); QPen yellow(Qt::black); yellow.setWidth(3); series3->setPen(yellow); diff --git a/examples/scatterchart/chartview.cpp b/examples/scatterchart/chartview.cpp index e00bd8f..d3e2ca0 100644 --- a/examples/scatterchart/chartview.cpp +++ b/examples/scatterchart/chartview.cpp @@ -6,10 +6,12 @@ ChartView::ChartView(QWidget *parent) : { //![1] QScatterSeries *series0 = new QScatterSeries(); + series0->setName("scatter1"); series0->setShape(QScatterSeries::MarkerShapeCircle); series0->setSize(15.0); QScatterSeries *series1 = new QScatterSeries(); + series1->setName("scatter2"); series1->setShape(QScatterSeries::MarkerShapeCircle); series1->setSize(20.0); //![1] diff --git a/examples/scatterinteractions/chartview.cpp b/examples/scatterinteractions/chartview.cpp index 60b4d01..1867c99 100644 --- a/examples/scatterinteractions/chartview.cpp +++ b/examples/scatterinteractions/chartview.cpp @@ -32,12 +32,14 @@ ChartView::ChartView(QWidget *parent) chart()->setTitle("Click to interact with scatter points"); m_scatter = new QScatterSeries(); + m_scatter->setName("scatter1"); for(qreal x(0.5); x <= 4.0; x += 0.5) { for(qreal y(0.5); y <= 4.0; y += 0.5) { *m_scatter << QPointF(x, y); } } m_scatter2 = new QScatterSeries(); + m_scatter2->setName("scatter2"); chart()->addSeries(m_scatter2); chart()->addSeries(m_scatter); diff --git a/examples/splinechart/main.cpp b/examples/splinechart/main.cpp index 496b3c3..b180720 100644 --- a/examples/splinechart/main.cpp +++ b/examples/splinechart/main.cpp @@ -31,6 +31,7 @@ int main(int argc, char *argv[]) //![1] QSplineSeries* series = new QSplineSeries(); + series->setName("spline"); //![1] //![2] diff --git a/examples/zoomlinechart/main.cpp b/examples/zoomlinechart/main.cpp index 39d9967..0993e8a 100644 --- a/examples/zoomlinechart/main.cpp +++ b/examples/zoomlinechart/main.cpp @@ -32,6 +32,7 @@ int main(int argc, char *argv[]) //![1] QLineSeries* series = new QLineSeries(); + series->setName("line"); qreal yValue = 0.0; for (int i(0); i < 500; i++) { yValue = yValue + (qreal) (qrand() % 10) / 500.0;