From 267764825d2308f4389f6c6c2ad855634128ce3d 2012-06-20 13:33:39 From: Tero Ahola Date: 2012-06-20 13:33:39 Subject: [PATCH] QML model mapper documentation for pie and xy --- diff --git a/src/barchart/qhbarmodelmapper.cpp b/src/barchart/qhbarmodelmapper.cpp index c365f52..47b79ed 100644 --- a/src/barchart/qhbarmodelmapper.cpp +++ b/src/barchart/qhbarmodelmapper.cpp @@ -35,13 +35,14 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! \qmlclass HBarModelMapper QHBarModelMapper - \mainclass HBarModelMapper allows you to use your own QAbstractItemModel derived model with data in rows as a data source - for any bar series. Adding/removing value from the BarSet causes the the same change in the rest of the BarSets - added to the same series. The following QML example would create a bar series with three bar sets (assuming the - model has at least four rows). Each bar set would contain data starting from column 1. The name of a set would be - defined by the vertical header (of the row). + for any bar series. It is possible to use both QAbstractItemModel and bar series data API to manipulate data. + HBarModelMapper keeps the series and the model in sync. + + The following QML example would create a bar series with three bar sets (assuming the model has + at least four rows). Each bar set would contain data starting from column 1. The name of a set would be defined by + the vertical header (of the row). \code BarSeries { HBarModelMapper { @@ -72,7 +73,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief Defines the model that is used by the mapper. */ /*! - \qmlproperty Model HBarModelMapper::model + \qmlproperty SomeModel HBarModelMapper::model The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns and modifying the data of the cells. diff --git a/src/barchart/qvbarmodelmapper.cpp b/src/barchart/qvbarmodelmapper.cpp index 38ab662..2276f4b 100644 --- a/src/barchart/qvbarmodelmapper.cpp +++ b/src/barchart/qvbarmodelmapper.cpp @@ -38,8 +38,10 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \mainclass VBarModelMapper allows you to use your own QAbstractItemModel derived model with data in columns as a data source - for any bar series. Adding/removing value from the BarSet causes the the same change in the rest of the BarSets - added to the same series. The following QML example would create a bar series with three bar sets (assuming the + for any bar series. It is possible to use both QAbstractItemModel and bar series data API to manipulate data. + VBarModelMapper keeps the series and the model in sync. + + The following QML example would create a bar series with three bar sets (assuming the model has at least four columns). Each bar set would contain data starting from row 1. The name of a set would be defined by the horizontal header (of the column). \code @@ -72,7 +74,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief Defines the model that is used by the mapper. */ /*! - \qmlproperty Model VBarModelMapper::model + \qmlproperty SomeModel VBarModelMapper::model The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns and modifying the data of the cells. diff --git a/src/piechart/qhpiemodelmapper.cpp b/src/piechart/qhpiemodelmapper.cpp index e4d54b8..22827ef 100644 --- a/src/piechart/qhpiemodelmapper.cpp +++ b/src/piechart/qhpiemodelmapper.cpp @@ -31,6 +31,26 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE It is possible to use both QAbstractItemModel and QPieSeries model API. QHPieModelMapper makes sure that Pie and the model are kept in sync. NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. */ +/*! + \qmlclass HPieModelMapper QHPieModelMapper + + HPieModelMapper allows you to use your own QAbstractItemModel derived model with data in rows as a data source + for a pie series. It is possible to use both QAbstractItemModel and PieSeries data API to manipulate data. + HPieModelMapper keeps the Pie and the model in sync. + + The following QML example would create a pie series with four slices (assuming the model has + at least five columns). Each slice would contain a label from row 1 and a value from row 2. + \code + HPieModelMapper { + series: pieSeries + model: customModel + labelsRow: 1 + valuesRow: 2 + firstColumn: 1 + columnCount: 4 + } + \endcode +*/ /*! \property QHPieModelMapper::series @@ -39,23 +59,43 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE All the data in the series is discarded when it is set to the mapper. When new series is specified the old series is disconnected (it preserves its data) */ +/*! + \qmlproperty PieSeries HPieModelMapper::series + Defines the PieSeries object that is used by the mapper. If you define the mapper element as a child for a + PieSeries, leave this property undefined. All the data in the series is discarded when it is set to the mapper. + When new series is specified the old series is disconnected (it preserves its data). +*/ /*! \property QHPieModelMapper::model \brief Defines the model that is used by the mapper. */ +/*! + \qmlproperty SomeModel HPieModelMapper::model + The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to + QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns + and modifying the data of the cells. +*/ /*! \property QHPieModelMapper::valuesRow \brief Defines which row of the model is kept in sync with the values of the pie's slices - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int HPieModelMapper::valuesRow + Defines which row of the model is kept in sync with the values of the pie's slices. Default value is: -1 (invalid + mapping). +*/ /*! \property QHPieModelMapper::labelsRow \brief Defines which row of the model is kept in sync with the labels of the pie's slices - + Default value is: -1 (invalid mapping) +*/ +/*! + \qmlproperty int HPieModelMapper::labelsRow + Defines which row of the model is kept in sync with the labels of the pie's slices Default value is: -1 (invalid mapping) */ @@ -65,7 +105,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: 0 */ /*! - \qmlproperty int QHPieModelMapper::firstColumn + \qmlproperty int HPieModelMapper::firstColumn Defines which column of the model contains the first slice value. The default value is 0. */ @@ -76,32 +116,28 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: -1 (count limited by the number of columns in the model) */ /*! - \qmlproperty int QHPieModelMapper::columnCount + \qmlproperty int HPieModelMapper::columnCount Defines the number of columns of the model that are mapped as the data for QPieSeries. The default value is -1 (count limited by the number of columns in the model) */ /*! \fn void QHPieModelMapper::seriesReplaced() - Emitted when the series to which mapper is connected to has changed. */ /*! \fn void QHPieModelMapper::modelReplaced() - Emitted when the model to which mapper is connected to has changed. */ /*! \fn void QHPieModelMapper::valuesRowChanged() - Emitted when the valuesRow has changed. */ /*! \fn void QHPieModelMapper::labelsRowChanged() - Emitted when the labelsRow has changed. */ diff --git a/src/piechart/qvpiemodelmapper.cpp b/src/piechart/qvpiemodelmapper.cpp index 8656700..ca93d83 100644 --- a/src/piechart/qvpiemodelmapper.cpp +++ b/src/piechart/qvpiemodelmapper.cpp @@ -31,33 +31,72 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE It is possible to use both QAbstractItemModel and QPieSeries model API. QVPieModelMapper makes sure that Pie and the model are kept in sync. NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. */ +/*! + \qmlclass VPieModelMapper QVPieModelMapper + + VPieModelMapper allows you to use your own QAbstractItemModel derived model with data in columns as a data source + for a pie series. It is possible to use both QAbstractItemModel and PieSeries data API to manipulate data. + VPieModelMapper keeps the Pie and the model in sync. + + The following QML example would create a pie series with four slices (assuming the model has at least five rows). + Each slice would contain a label from column 1 and a value from column 2. + \code + VPieModelMapper { + series: pieSeries + model: customModel + labelsColumn: 1 + valuesColumn: 2 + firstRow: 1 + rowCount: 4 + } + \endcode +*/ /*! \property QVPieModelMapper::series \brief Defines the QPieSeries object that is used by the mapper. - All the data in the series is discarded when it is set to the mapper. When new series is specified the old series is disconnected (it preserves its data) */ +/*! + \qmlproperty PieSeries VPieModelMapper::series + Defines the PieSeries object that is used by the mapper. If you define the mapper element as a child for a + PieSeries, leave this property undefined. All the data in the series is discarded when it is set to the mapper. + When new series is specified the old series is disconnected (it preserves its data). +*/ /*! \property QVPieModelMapper::model \brief Defines the model that is used by the mapper. */ +/*! + \qmlproperty SomeModel VPieModelMapper::model + The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to + QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns + and modifying the data of the cells. +*/ /*! \property QVPieModelMapper::valuesColumn \brief Defines which column of the model is kept in sync with the values of the pie's slices - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int VPieModelMapper::valuesColumn + Defines which column of the model is kept in sync with the values of the pie's slices. Default value is -1 (invalid + mapping). +*/ /*! \property QVPieModelMapper::labelsColumn \brief Defines which column of the model is kept in sync with the labels of the pie's slices - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int VPieModelMapper::labelsColumn + Defines which column of the model is kept in sync with the labels of the pie's slices. Default value is -1 (invalid + mapping). +*/ /*! \property QVPieModelMapper::firstRow @@ -65,7 +104,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: 0 */ /*! - \qmlproperty int QVPieModelMapper::firstRow + \qmlproperty int VPieModelMapper::firstRow Defines which row of the model contains the first slice value. The default value is 0. */ @@ -76,7 +115,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: -1 (count limited by the number of rows in the model) */ /*! - \qmlproperty int QVPieModelMapper::columnCount + \qmlproperty int VPieModelMapper::columnCount Defines the number of rows of the model that are mapped as the data for QPieSeries. The default value is -1 (count limited by the number of rows in the model) */ diff --git a/src/xychart/qhxymodelmapper.cpp b/src/xychart/qhxymodelmapper.cpp index 8467168..b8a038f 100644 --- a/src/xychart/qhxymodelmapper.cpp +++ b/src/xychart/qhxymodelmapper.cpp @@ -31,32 +31,58 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE It is possible to use both QAbstractItemModel and QXYSeries model API. QXYModelMapper makes sure that QXYSeries and the model are kept in sync. NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. */ +/*! + \qmlclass HXYModelMapper QHXYModelMapper + + HXYModelMapper allows you to use your own QAbstractItemModel derived model with data in rows as a data source + for XYSeries based series. It is possible to use both QAbstractItemModel and XYSeries data API to manipulate data. + HXYModelMapper keeps the series and the model in sync. +*/ /*! \property QHXYModelMapper::series \brief Defines the QXYSeries object that is used by the mapper. - All the data in the series is discarded when it is set to the mapper. When new series is specified the old series is disconnected (it preserves its data) */ +/*! + \qmlproperty XYSeries HXYModelMapper::series + Defines the QXYSeries object that is used by the mapper. All the data in the series is discarded when it is set to + the mapper. When new series is specified the old series is disconnected (it preserves its data). +*/ /*! \property QHXYModelMapper::model \brief Defines the model that is used by the mapper. */ +/*! + \qmlproperty SomeModel HXYModelMapper::model + The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to + QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns + and modifying the data of the cells. +*/ /*! \property QHXYModelMapper::xRow \brief Defines which row of the model is kept in sync with the x values of the QXYSeries Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int HXYModelMapper::xRow + Defines which row of the model is kept in sync with the x values of the QXYSeries. Default value is -1 (invalid + mapping). +*/ /*! \property QHXYModelMapper::yRow \brief Defines which row of the model is kept in sync with the y values of the QXYSeries - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int HXYModelMapper::yRow + Defines which row of the model is kept in sync with the y values of the QXYSeries. Default value is -1 + (invalid mapping). +*/ /*! \property QHXYModelMapper::firstColumn @@ -64,7 +90,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: 0 */ /*! - \qmlproperty int QHXYModelMapper::firstColumn + \qmlproperty int HXYModelMapper::firstColumn Defines which column of the model contains the data for the first point of the series. The default value is 0. */ @@ -75,7 +101,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: -1 (count limited by the number of columns in the model) */ /*! - \qmlproperty int QHXYModelMapper::columnCount + \qmlproperty int HXYModelMapper::columnCount Defines the number of columns of the model that are mapped as the data for series. The default value is -1 (count limited by the number of columns in the model) */ diff --git a/src/xychart/qvxymodelmapper.cpp b/src/xychart/qvxymodelmapper.cpp index f33bd2e..ba50633 100644 --- a/src/xychart/qvxymodelmapper.cpp +++ b/src/xychart/qvxymodelmapper.cpp @@ -31,33 +31,58 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE It is possible to use both QAbstractItemModel and QXYSeries model API. QXYModelMapper makes sure that QXYSeries and the model are kept in sync. NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. */ +/*! + \qmlclass VXYModelMapper QHXYModelMapper + + VXYModelMapper allows you to use your own QAbstractItemModel derived model with data in columns as a data source + for XYSeries based series. It is possible to use both QAbstractItemModel and XYSeries data API to manipulate data. + VYModelMapper keeps the series and the model in sync. +*/ /*! \property QVXYModelMapper::series \brief Defines the QXYSeries object that is used by the mapper. - All the data in the series is discarded when it is set to the mapper. When new series is specified the old series is disconnected (it preserves its data) */ +/*! + \qmlproperty XYSeries VXYModelMapper::series + Defines the QXYSeries object that is used by the mapper. All the data in the series is discarded when it is set to + the mapper. When new series is specified the old series is disconnected (it preserves its data). +*/ /*! \property QVXYModelMapper::model \brief Defines the model that is used by the mapper. */ +/*! + \qmlproperty SomeModel VXYModelMapper::model + The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to + QML as shown in \l {QML Custom Model} demo application. NOTE: the model has to support adding/removing rows/columns + and modifying the data of the cells. +*/ /*! \property QVXYModelMapper::xColumn \brief Defines which column of the model is kept in sync with the x values of QXYSeries - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int VXYModelMapper::xColumn + Defines which column of the model is kept in sync with the x values of XYSeries. Default value is -1 (invalid + mapping). +*/ /*! \property QVXYModelMapper::yColumn \brief Defines which column of the model is kept in sync with the y values of QXYSeries - Default value is: -1 (invalid mapping) */ +/*! + \qmlproperty int VXYModelMapper::yColumn + Defines which column of the model is kept in sync with the y values of QXYSeries. Default value is -1 (invalid + mapping). +*/ /*! \property QVXYModelMapper::firstRow @@ -65,7 +90,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: 0 */ /*! - \qmlproperty int QVXYModelMapper::firstRow + \qmlproperty int VXYModelMapper::firstRow Defines which row of the model contains the data for the first point of the series. The default value is 0. */ @@ -76,9 +101,9 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Minimal and default value is: -1 (count limited by the number of rows in the model) */ /*! - \qmlproperty int QVXYModelMapper::columnCount + \qmlproperty int VXYModelMapper::columnCount Defines the number of rows of the model that are mapped as the data for series. The default value is - -1 (count limited by the number of rows in the model) + -1 (count limited by the number of rows in the model). */ /*!