diff --git a/doc/src/qml.qdoc b/doc/src/qml.qdoc index fcace0b..72de20f 100644 --- a/doc/src/qml.qdoc +++ b/doc/src/qml.qdoc @@ -9,11 +9,6 @@ \snippet ../examples/qmlpiechart/qml/qmlpiechart/main.qml 2 \snippet ../examples/qmlpiechart/qml/qmlpiechart/main.qml 3 - \beginfloatleft - \image examples_qmlpiechart.png - \endfloat - \clearfloat - \raw HTML diff --git a/plugins/declarative/declarativeareaseries.cpp b/plugins/declarative/declarativeareaseries.cpp index c138b68..62adf04 100644 --- a/plugins/declarative/declarativeareaseries.cpp +++ b/plugins/declarative/declarativeareaseries.cpp @@ -25,20 +25,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -/*! - \qmlclass AreaSeries QAreaSeries - - \section1 Example Usage - - \beginfloatleft - \image demos_qmlchart4.png - \endfloat - \clearfloat - - The following QML shows how to create a simple area chart: - \snippet ../demos/qmlchart/qml/qmlchart/View4.qml 1 -*/ - DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) : QAreaSeries(parent) { diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp index 06d5863..3aff59c 100644 --- a/plugins/declarative/declarativechart.cpp +++ b/plugins/declarative/declarativechart.cpp @@ -34,11 +34,13 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE ChartView element is the parent that is responsible for showing different chart series types. - The following QML shows how to create a simple line chart: - \snippet ../demos/qmlchart/qml/qmlchart/View2.qml 1 + The following QML shows how to create a simple chart with one pie series: + \snippet ../examples/qmlpiechart/qml/qmlpiechart/main.qml 1 + \snippet ../examples/qmlpiechart/qml/qmlpiechart/main.qml 2 + \snippet ../examples/qmlpiechart/qml/qmlpiechart/main.qml 3 \beginfloatleft - \image demos_qmlchart2.png + \image examples_qmlpiechart.png \endfloat \clearfloat */ diff --git a/plugins/declarative/declarativelineseries.cpp b/plugins/declarative/declarativelineseries.cpp index 5ab920a..dda1f5f 100644 --- a/plugins/declarative/declarativelineseries.cpp +++ b/plugins/declarative/declarativelineseries.cpp @@ -25,18 +25,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -/*! - \qmlclass LineSeries QLineSeries - - \beginfloatleft - \image demos_qmlchart2.png - \endfloat - \clearfloat - - The following QML shows how to create a simple line chart: - \snippet ../demos/qmlchart/qml/qmlchart/View2.qml 1 -*/ - DeclarativeLineSeries::DeclarativeLineSeries(QObject *parent) : QLineSeries(parent) { diff --git a/plugins/declarative/declarativepieseries.cpp b/plugins/declarative/declarativepieseries.cpp index 2b0afcb..6d47259 100644 --- a/plugins/declarative/declarativepieseries.cpp +++ b/plugins/declarative/declarativepieseries.cpp @@ -27,53 +27,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -/*! - \qmlclass PieSeries QPieSeries - - \section1 Example Usage - - \beginfloatleft - \image demos_qmlchart1.png - \endfloat - \clearfloat - - The following QML shows how to create a simple pie chart. - - \snippet ../demos/qmlchart/qml/qmlchart/View1.qml 1 -*/ - -/*! - \qmlproperty real PieSeries::horizontalPosition - \brief Defines the horizontal position of the pie. - - The value is a relative value to the chart rectangle where: - - \list - \o 0.0 is the absolute left. - \o 1.0 is the absolute right. - \endlist - - Default value is 0.5 (center). - - \sa verticalPosition -*/ - -/*! - \qmlproperty real PieSeries::verticalPosition - \brief Defines the vertical position of the pie. - - The value is a relative value to the chart rectangle where: - - \list - \o 0.0 is the absolute top. - \o 1.0 is the absolute bottom. - \endlist - - Default value is 0.5 (center). - - \sa horizontalPosition -*/ - DeclarativePieSeries::DeclarativePieSeries(QObject *parent) : QPieSeries(parent) { diff --git a/plugins/declarative/declarativescatterseries.cpp b/plugins/declarative/declarativescatterseries.cpp index 053b9f1..53deebb 100644 --- a/plugins/declarative/declarativescatterseries.cpp +++ b/plugins/declarative/declarativescatterseries.cpp @@ -25,19 +25,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -/*! - \qmlclass ScatterSeries QScatterSeries - - The following QML shows how to create a chart with two simple scatter series: - \snippet ../demos/qmlchart/qml/qmlchart/View5.qml 1 - \snippet ../demos/qmlchart/qml/qmlchart/View5.qml 2 - - \beginfloatleft - \image demos_qmlchart5.png - \endfloat - \clearfloat -*/ - DeclarativeScatterSeries::DeclarativeScatterSeries(QObject *parent) : QScatterSeries(parent) { diff --git a/plugins/declarative/declarativesplineseries.cpp b/plugins/declarative/declarativesplineseries.cpp index f6bb78b..e924f4a 100644 --- a/plugins/declarative/declarativesplineseries.cpp +++ b/plugins/declarative/declarativesplineseries.cpp @@ -25,20 +25,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -/*! - \qmlclass SplineSeries QSplineSeries - - \section1 Example Usage - - \beginfloatleft - \image demos_qmlchart3.png - \endfloat - \clearfloat - - The following QML shows how to create a simple spline chart: - \snippet ../demos/qmlchart/qml/qmlchart/View3.qml 1 -*/ - DeclarativeSplineSeries::DeclarativeSplineSeries(QObject *parent) : QSplineSeries(parent) { diff --git a/plugins/declarative/declarativexypoint.cpp b/plugins/declarative/declarativexypoint.cpp index 5e303b9..a36508e 100644 --- a/plugins/declarative/declarativexypoint.cpp +++ b/plugins/declarative/declarativexypoint.cpp @@ -22,6 +22,23 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE +/*! + \qmlclass XyPoint QPointF + XyPoint is a convenience element for initializing XY-series with static coordinate data. To + manipulate an XY-series dynamically, use it's data manipulation functions instead. + \sa LineSeries, AreaSeries, ScatterSeries, SplineSeries +*/ + +/*! + \qmlproperty real XyPoint::x + The x-coordinate of the point. +*/ + +/*! + \qmlproperty real XyPoint::y + The y-coordinate of the point. +*/ + DeclarativeXyPoint::DeclarativeXyPoint(QObject *parent) : QObject(parent) { diff --git a/plugins/declarative/plugin.cpp b/plugins/declarative/plugin.cpp index 80f7028..728894b 100644 --- a/plugins/declarative/plugin.cpp +++ b/plugins/declarative/plugin.cpp @@ -69,8 +69,8 @@ public: qmlRegisterUncreatableType(uri, 1, 0, "Legend", QLatin1String("Trying to create uncreatable: Legend.")); - qmlRegisterUncreatableType(uri, 1, 0, "QXYSeries", - QLatin1String("Trying to create uncreatable: QXYSeries.")); + qmlRegisterUncreatableType(uri, 1, 0, "XYSeries", + QLatin1String("Trying to create uncreatable: XYSeries.")); qmlRegisterUncreatableType(uri, 1, 0, "QScatterSeries", QLatin1String("Trying to create uncreatable: QScatterSeries.")); qmlRegisterUncreatableType(uri, 1, 0, "QPieSeries", diff --git a/src/areachart/qareaseries.cpp b/src/areachart/qareaseries.cpp index 5c49148..a60bb3e 100644 --- a/src/areachart/qareaseries.cpp +++ b/src/areachart/qareaseries.cpp @@ -45,29 +45,56 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart. \image examples_areachart.png */ +/*! + \qmlclass AreaSeries QAreaSeries + + The following QML shows how to create a simple area chart: + \snippet ../demos/qmlchart/qml/qmlchart/View4.qml 1 + \beginfloatleft + \image demos_qmlchart4.png + \endfloat + \clearfloat +*/ /*! \property QAreaSeries::upperSeries \brief The upper one of the two line series used to define area series boundaries. */ +/*! + \qmlproperty LineSeries AreaSeries::upperSeries + The upper one of the two line series used to define area series boundaries. +*/ /*! \property QAreaSeries::lowerSeries The lower one of the two line series used to define are series boundaries. Note if QAreaSeries was counstucted wihtout a\ lowerSeries this is null. */ +/*! + \qmlproperty LineSeries AreaSeries::lowerSeries + The lower one of the two line series used to define are series boundaries. Note if + AreaSeries was counstucted wihtout a\ lowerSeries this is null. +*/ /*! \property QAreaSeries::color Fill (brush) color of the series. This is a convenience property for modifying the color of brush. \sa QAreaSeries::brush() */ +/*! + \qmlproperty color AreaSeries::color + Fill (brush) color of the series. +*/ /*! \property QAreaSeries::borderColor Line (pen) color of the series. This is a convenience property for modifying the color of pen. \sa QAreaSeries::pen() */ +/*! + \qmlproperty color AreaSeries::borderColor + Line (pen) color of the series. +*/ /*! \fn QPen QAreaSeries::pen() const @@ -85,29 +112,39 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \fn void QAreaSeries::colorChanged(QColor color) \brief Signal is emitted when the fill (brush) color has changed to \a color. */ +/*! + \qmlsignal AreaSeries::colorChanged(color color) + Signal is emitted when the fill (brush) color has changed to \a color. +*/ /*! \fn void QAreaSeries::borderColorChanged(QColor color) \brief Signal is emitted when the line (pen) color has changed to \a color. */ - /*! - \fn bool QAreaSeries::pointsVisible() const - \brief Returns if the points are drawn for this series. - \sa setPointsVisible() + \qmlsignal AreaSeries::borderColorChanged(color color) + Signal is emitted when the line (pen) color has changed to \a color. */ /*! \fn void QAreaSeries::clicked(const QPointF& point) \brief Signal is emitted when user clicks the \a point on area chart. */ +/*! + \qmlsignal AreaSeries::clicked(QPointF point) + Signal is emitted when user clicks the \a point on area chart. +*/ /*! \fn void QAreaSeries::selected() - The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be implemented by the user of QAreaSeries API. */ +/*! + \qmlsignal AreaSeries::selected() + The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be + implemented by the user of AreaSeries API. +*/ /*! \fn void QAreaSeriesPrivate::updated() @@ -256,6 +293,10 @@ void QAreaSeries::setPointsVisible(bool visible) } } +/*! + Returns if the points are drawn for this series. + \sa setPointsVisible() +*/ bool QAreaSeries::pointsVisible() const { Q_D(const QAreaSeries); diff --git a/src/linechart/qlineseries.cpp b/src/linechart/qlineseries.cpp index 15d9720..70f52dd 100644 --- a/src/linechart/qlineseries.cpp +++ b/src/linechart/qlineseries.cpp @@ -47,6 +47,17 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE chart->addSeries(series); \endcode */ +/*! + \qmlclass LineSeries QLineSeries + \inherits XYSeries + + The following QML shows how to create a simple line chart: + \snippet ../demos/qmlchart/qml/qmlchart/View2.qml 1 + \beginfloatleft + \image demos_qmlchart2.png + \endfloat + \clearfloat +*/ /*! \fn virtual SeriesType QLineSeries::type() const diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 218c19f..2550c41 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -48,36 +48,58 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE See the \l {PieChart Example} {pie chart example} to learn how to create a simple pie chart. \image examples_piechart.png */ +/*! + \qmlclass PieSeries QPieSeries + + The following QML shows how to create a simple pie chart. + \snippet ../demos/qmlchart/qml/qmlchart/View1.qml 1 + \beginfloatleft + \image demos_qmlchart1.png + \endfloat + \clearfloat +*/ /*! \property QPieSeries::horizontalPosition \brief Defines the horizontal position of the pie. - The value is a relative value to the chart rectangle where: - \list \o 0.0 is the absolute left. \o 1.0 is the absolute right. \endlist - Default value is 0.5 (center). - + \sa verticalPosition +*/ +/*! + \qmlproperty real PieSeries::horizontalPosition + Defines the horizontal position of the pie. The value is a relative value to the chart rectangle where: + \list + \o 0.0 is the absolute left. + \o 1.0 is the absolute right. + \endlist + Default value is 0.5 (center). \sa verticalPosition */ /*! \property QPieSeries::verticalPosition \brief Defines the vertical position of the pie. - The value is a relative value to the chart rectangle where: - \list \o 0.0 is the absolute top. \o 1.0 is the absolute bottom. \endlist - Default value is 0.5 (center). - + \sa horizontalPosition +*/ +/*! + \qmlproperty real PieSeries::verticalPosition + Defines the vertical position of the pie. The value is a relative value to the chart rectangle where: + \list + \o 0.0 is the absolute top. + \o 1.0 is the absolute bottom. + \endlist + Default value is 0.5 (center). \sa horizontalPosition */ diff --git a/src/scatterchart/qscatterseries.cpp b/src/scatterchart/qscatterseries.cpp index 1c6095e..31c3071 100644 --- a/src/scatterchart/qscatterseries.cpp +++ b/src/scatterchart/qscatterseries.cpp @@ -45,6 +45,19 @@ chart->addSeries(series); \endcode */ +/*! + \qmlclass ScatterSeries QScatterSeries + \inherits XYSeries + + The following QML shows how to create a chart with two simple scatter series: + \snippet ../demos/qmlchart/qml/qmlchart/View5.qml 1 + \snippet ../demos/qmlchart/qml/qmlchart/View5.qml 2 + + \beginfloatleft + \image demos_qmlchart5.png + \endfloat + \clearfloat +*/ /*! \enum QScatterSeries::MarkerShape @@ -68,30 +81,42 @@ */ /*! - \property QScatterSeries::markerShape - - Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle. + \property QScatterSeries::markerShape + Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle. */ - /*! - \property QScatterSeries::markerSize + \qmlproperty MarkerShape ScatterSeries::markerShape + Defines the shape of the marker used to draw the points in the series. One of ScatterSeries + ScatterSeries.MarkerShapeCircle or ScatterSeries.MarkerShapeRectangle. + The default shape is ScatterSeries.MarkerShapeCircle. +*/ - Defines the size of the marker used to draw the points in the series. The default size is 15.0. +/*! + \property QScatterSeries::markerSize + Defines the size of the marker used to draw the points in the series. The default size is 15.0. +*/ +/*! + \qmlproperty real ScatterSeries::markerSize + Defines the size of the marker used to draw the points in the series. The default size is 15.0. */ /*! \fn void QScatterSeries::colorChanged(QColor color) - \brief Signal is emitted when the fill (brush) color has changed to \a color. + Signal is emitted when the fill (brush) color has changed to \a color. */ /*! \fn void QScatterSeries::borderColorChanged(QColor color) - \brief Signal is emitted when the line (pen) color has changed to \a color. + Signal is emitted when the line (pen) color has changed to \a color. +*/ +/*! + \qmlsignal ScatterSeries::borderColorChanged(color color) + Signal is emitted when the line (pen) color has changed to \a color. */ /*! \fn QChartSeriesType QScatterSeries::type() const - \brief Returns QChartSeries::SeriesTypeScatter. + Returns QChartSeries::SeriesTypeScatter. \sa QAbstractSeries, SeriesType */ diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp index ffa2a81..fd90712 100644 --- a/src/splinechart/qsplineseries.cpp +++ b/src/splinechart/qsplineseries.cpp @@ -45,9 +45,21 @@ */ /*! - \fn QSeriesType QSplineSeries::type() const - Returns the type of the series - */ + \qmlclass SplineSeries QSplineSeries + \inherits XYSeries + + The following QML shows how to create a simple spline chart: + \snippet ../demos/qmlchart/qml/qmlchart/View3.qml 1 + \beginfloatleft + \image demos_qmlchart3.png + \endfloat + \clearfloat +*/ + +/*! + \fn QSeriesType QSplineSeries::type() const + Returns the type of the series +*/ QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index c906ca0..6c96741 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -29,10 +29,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \class QXYSeries \brief The QXYSeries class is a base class for line, spline and scatter series. */ +/*! + \qmlclass XYSeries + \brief The XYSeries class is a base class for line, spline and scatter series. + + The class cannot be instantiated directly. +*/ /*! \property QXYSeries::pointsVisible - + Controls if the data points are visible and should be drawn. +*/ +/*! + \qmlproperty bool XYSeries::pointsVisible Controls if the data points are visible and should be drawn. */ @@ -50,37 +59,70 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QXYSeries::color - Line (pen) color of the series. This is a convenience property for modifying the color of pen. - \sa QXYSeries::pen() + The color of the series. This is line (pen) color in case of QLineSeries or QSplineSeries and + fill (brush) color in case of QScatterSeries or QAreaSeries. + \sa QXYSeries::pen(), QXYSeries::brush() +*/ +/*! + \qmlproperty color XYSeries::color + The color of the series. This is line (pen) color in case of LineSeries or SplineSeries and + fill (brush) color in case of ScatterSeries or AreaSeries. */ /*! \fn void QXYSeries::clicked(const QPointF& point) \brief Signal is emitted when user clicks the \a point on chart. */ +/*! + \qmlsignal XYSeries::onClicked(QPointF point) + Signal is emitted when user clicks the \a point on chart. For example: + \code + LineSeries { + XyPoint { x: 0; y: 0 } + XyPoint { x: 1.1; y: 2.1 } + onClicked: console.log("onClicked: " + point.x + ", " + point.y); + } + \endcode +*/ /*! \fn void QXYSeries::pointReplaced(int index) - \brief Signal is emitted when user replaces a point at \a index. + Signal is emitted when a point has been replaced at \a index. \sa replace() */ +/*! + \qmlsignal XYSeries::pointReplaced(int index) + Signal is emitted when a point has been replaced at \a index. +*/ /*! \fn void QXYSeries::pointAdded(int index) - \brief Signal is emitted when user adds a point at \a index. + Signal is emitted when a point has been added at \a index. \sa append(), insert() */ +/*! + \qmlsignal XYSeries::pointAdded(int index) + Signal is emitted when a point has been added at \a index. +*/ /*! \fn void QXYSeries::pointRemoved(int index) - \brief Signal is emitted when user removes a point at \a index. + Signal is emitted when a point has been removed from \a index. \sa remove() */ +/*! + \qmlsignal XYSeries::pointRemoved(int index) + Signal is emitted when a point has been removed from \a index. +*/ /*! \fn void QXYSeries::colorChanged(QColor color) \brief Signal is emitted when the line (pen) color has changed to \a color. */ +/*! + \qmlsignal XYSeries::colorChanged(QColor color) + Signal is emitted when the line (pen) color has changed to \a color. +*/ /*! \fn void QXYSeriesPrivate::updated() @@ -88,6 +130,10 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \qmlmethod XyPoint XYSeries::at(int index) +*/ + +/*! \internal Constructs empty series object which is a child of \a parent. diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml index b11e89f..111f036 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml @@ -32,6 +32,8 @@ ChartView { AreaSeries { id: daSeries name: "area 1" + onSelected: console.log("areaSeries.onSelected"); + onClicked: console.log("areaSeries.onClicked: " + point.x + ", " + point.y); upperSeries: LineSeries { XyPoint { x: 0; y: 1 } XyPoint { x: 1; y: 1 } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml index 518737c..f4cfcec 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml @@ -35,7 +35,10 @@ ChartView { name: "bar" onClicked: console.log("onClicked: " + barset + " " + index); onHovered: console.log("onHovered: " + barset + " " + status); - BarSet { label: "Bob"; values: [4, 7, 3, 10, 5, 6] } + BarSet { label: "Bob"; values: [4, 7, 3, 10, 5, 6] + onClicked: console.log("barset.onClicked: " + index); + onHovered: console.log("barset.onHovered: " + status); + } BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 8] } BarSet { label: "James"; values: [3, 5, 8, 5, 4, 7] } } diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml index dfcd966..5b38ea2 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml @@ -30,6 +30,7 @@ ChartView { LineSeries { id: daSeries name: "line 1" + onClicked: console.log("onClicked: " + point.x + ", " + point.y); XyPoint { x: 0; y: 0 } XyPoint { x: 1.1; y: 2.1 } XyPoint { x: 1.9; y: 3.3 }