diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2017-01-02 16:41:32 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-01-05 05:46:46 +0000 |
commit | 5463e1d5710fcc28485a964c761c2fd8a91ef736 (patch) | |
tree | 0efb3fd7ad3926056709180f4c3738fb69239536 | |
parent | 2a01e2d19df19d6fca2f810aefef581f5c694e14 (diff) |
Doc: Edit candlestick model mapper class and type docs
Make the docs consistent with the changes made for the other
classes and types in the module.
Change-Id: Iff88cb77c04c8e163ca558c8d136640c742202f8
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/charts/candlestickchart/qhcandlestickmodelmapper.cpp | 131 | ||||
-rw-r--r-- | src/charts/candlestickchart/qvcandlestickmodelmapper.cpp | 135 |
2 files changed, 166 insertions, 100 deletions
diff --git a/src/charts/candlestickchart/qhcandlestickmodelmapper.cpp b/src/charts/candlestickchart/qhcandlestickmodelmapper.cpp index 37dd9060..bdcc95bb 100644 --- a/src/charts/candlestickchart/qhcandlestickmodelmapper.cpp +++ b/src/charts/candlestickchart/qhcandlestickmodelmapper.cpp @@ -36,15 +36,22 @@ QT_CHARTS_BEGIN_NAMESPACE \class QHCandlestickModelMapper \since 5.8 \inmodule Qt Charts - \brief Horizontal model mapper for a candlestick series. + \brief The QHCandlestickModelMapper class is a horizontal model mapper for a candlestick series. + + Model mappers enable using a data model derived from the QAbstractItemModel class + as a data source for a chart. A horizontal model mapper is used to create a connection + between a data model and QCandlestickSeries, so that each row in the data model defines a + candlestick item and each column maps to the open, high, low, close, and timestamp values + of the candlestick item. + + Both model and candlestick series properties can be used to manipulate the data. The model + mapper keeps the candlestick series and the data model in sync. - Model mappers allow the use of a QAbstractItemModel-derived model as a data source for a chart - series, creating a connection between a QCandlestickSeries and the model object. A horizontal - model mapper maintains an equal size across all \l {QCandlestickSet} {QCandlestickSets}, and - reads the values of the set from the model's rows. + The model mapper ensures that all the candlestick items in the candlestick series have equal + sizes. Therefore, adding or removing a value from a candlestick item causes the same change to + be made in all the candlestick items in the candlestick series. - \note The model used must support adding and removing rows/columns and modifying the data of the - cells. + \sa QCandlestickSeries, QCandlestickSet, QVCandlestickModelMapper */ /*! @@ -54,13 +61,22 @@ QT_CHARTS_BEGIN_NAMESPACE \inqmlmodule QtCharts \brief Horizontal model mapper for a candlestick series. - HCandlestickModelMapper allows the use of a QAbstractItemModel-derived model with data in rows - as a data source for a candlestick series. It's possible to manipulate the data either through - QAbstractItemModel or QCandlestickSeries. + Model mappers enable using a data model derived from the QAbstractItemModel class + as a data source for a chart. A horizontal model mapper is used to create a connection + between a data model and CandlestickSeries, so that each row in the data model defines a + candlestick item and each column maps to the open, high, low, close, and timestamp values + of the candlestick item. - The following QML example creates a candlestick series with three candlestick sets (assuming the - model has at least four rows). Each candlestick set would contain data defined by timestamp, - open, high, low and close columns. The name of a set would be defined by the vertical header of + Both model and candlestick series properties can be used to manipulate the data. The model + mapper keeps the candlestick series and the data model in sync. + + The model mapper ensures that all the candlestick items in the candlestick series have equal + sizes. Therefore, adding or removing a value from a candlestick item causes the same change to + be made in all the candlestick items in the candlestick series. + + The following QML example creates a candlestick series with three candlestick items (assuming + the model has at least four rows). Each candlestick item contains data defined by the timestamp, + open, high, low, and close columns. The name of an item is defined by the vertical header of the row. \qml CandlestickSeries { @@ -77,21 +93,21 @@ QT_CHARTS_BEGIN_NAMESPACE } \endqml - \note HCandlestickModelMapper keeps the series and the model in sync. + \sa CandlestickSeries, CandlestickSet, VCandlestickModelMapper */ /*! \qmlproperty QAbstractItemModel HCandlestickModelMapper::model - \brief The QAbstractItemModel-based model that is used by the mapper. The model must be + The QAbstractItemModel-based model that is used by the mapper. The model must be implemented and exposed to QML. - \note The model used must support adding and removing rows/columns and modifying the data of the - cells. + \note The model used must support adding and removing rows or columns and modifying the data of + the cells. */ /*! \qmlproperty CandlestickSeries HCandlestickModelMapper::series - \brief Defines the CandlestickSeries based object that is used by the mapper. + The CandlestickSeries based object that is used by the mapper. All the data in the series is discarded when it is set to the mapper. When a new series is specified, the old series is disconnected (preserving its data). @@ -99,86 +115,103 @@ QT_CHARTS_BEGIN_NAMESPACE /*! \property QHCandlestickModelMapper::timestampColumn - \brief Defines the column of the model that contains the timestamp values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The column of the model that contains the timestamp values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::timestampColumn - \brief Defines the column of the model that contains the timestamp values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The column of the model that contains the timestamp values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QHCandlestickModelMapper::openColumn - \brief Defines the column of the model that contains the open values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The column of the model that contains the open values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::openColumn - \brief Defines the column of the model that contains the open values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The column of the model that contains the open values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QHCandlestickModelMapper::highColumn - \brief Defines the column of the model that contains the high values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The column of the model that contains the high values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::highColumn - \brief Defines the column of the model that contains the high values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The column of the model that contains the high values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QHCandlestickModelMapper::lowColumn - \brief Defines the column of the model that contains the low values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The column of the model that contains the low values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::lowColumn - \brief Defines the column of the model that contains the low values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The column of the model that contains the low values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QHCandlestickModelMapper::closeColumn - \brief Defines the column of the model that contains the close values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The column of the model that contains the close values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::closeColumn - \brief Defines the column of the model that contains the close values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The column of the model that contains the close values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QHCandlestickModelMapper::firstSetRow - \brief Defines the row of the model that is used as the data source for the first set. Default - value is -1 (invalid mapping). + \brief The row of the model that is used as the data source for the first item. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::firstSetRow - \brief Defines the row of the model that is used as the data source for the first set. Default - value is -1 (invalid mapping). + The row of the model that is used as the data source for the first item. + The default value is -1 (invalid mapping). */ /*! \property QHCandlestickModelMapper::lastSetRow - \brief Defines the row of the model that is used as the data source for the last set. Default - value is -1 (invalid mapping). + \brief The row of the model that is used as the data source for the last item. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int HCandlestickModelMapper::lastSetRow - \brief Defines the row of the model that is used as the data source for the last set. Default - value is -1 (invalid mapping). + The row of the model that is used as the data source for the last item. + The default value is -1 (invalid mapping). */ /*! @@ -212,13 +245,13 @@ QT_CHARTS_BEGIN_NAMESPACE /*! \fn void QHCandlestickModelMapper::firstSetRowChanged() - \brief Emitted when the row of the model that contains the data of the first set is changed. + \brief Emitted when the row of the model that contains the data of the first item is changed. \sa firstSetRow */ /*! \fn void QHCandlestickModelMapper::lastSetRowChanged() - \brief Emitted when the row of the model that contains the data of the last set is changed. + \brief Emitted when the row of the model that contains the data of the last item is changed. \sa lastSetRow */ @@ -238,7 +271,7 @@ QHCandlestickModelMapper::QHCandlestickModelMapper(QObject *parent) } /*! - Returns Qt::Horizontal. This means that values of the set are read from rows. + Returns Qt::Horizontal. This means that values of the item are read from rows. */ Qt::Orientation QHCandlestickModelMapper::orientation() const { diff --git a/src/charts/candlestickchart/qvcandlestickmodelmapper.cpp b/src/charts/candlestickchart/qvcandlestickmodelmapper.cpp index 17127c95..968e72b3 100644 --- a/src/charts/candlestickchart/qvcandlestickmodelmapper.cpp +++ b/src/charts/candlestickchart/qvcandlestickmodelmapper.cpp @@ -36,15 +36,22 @@ QT_CHARTS_BEGIN_NAMESPACE \class QVCandlestickModelMapper \since 5.8 \inmodule Qt Charts - \brief Vertical model mapper for a candlestick series. + \brief The QVCandlestickModelMapper class is a vertical model mapper for a candlestick series. + + Model mappers enable using a data model derived from the QAbstractItemModel class + as a data source for a chart. A vertical model mapper is used to create a connection + between a data model and QCandlestickSeries, so that each column in the data model defines a + candlestick item and each row maps to the open, high, low, close, and timestamp values + of the candlestick item. + + Both model and candlestick series properties can be used to manipulate the data. The model + mapper keeps the candlestick series and the data model in sync. - Model mappers allow the use of a QAbstractItemModel-derived model as a data source for a chart - series, creating a connection between a QCandlestickSeries and the model object. A vertical - model mapper maintains an equal size across all \l {QCandlestickSet} {QCandlestickSets}, and - reads the values of the set from the model's columns. + The model mapper ensures that all the candlestick items in the candlestick series have equal + sizes. Therefore, adding or removing a value from a candlestick item causes the same change to + be made in all the candlestick items in the candlestick series. - \note The model used must support adding and removing rows/columns and modifying the data of the - cells. + \sa QCandlestickSeries, QCandlestickSet, QHCandlestickModelMapper */ /*! @@ -54,14 +61,23 @@ QT_CHARTS_BEGIN_NAMESPACE \inqmlmodule QtCharts \brief Vertical model mapper for a candlestick series. - VCandlestickModelMapper allows the use of a QAbstractItemModel-derived model with data in - columns as a data source for a candlestick series. It's possible to manipulate the data either - through QAbstractItemModel or QCandlestickSeries. + Model mappers enable using a data model derived from the QAbstractItemModel class + as a data source for a chart. A vertical model mapper is used to create a connection + between a data model and CandlestickSeries, so that each column in the data model defines a + candlestick item and each row maps to the open, high, low, close, and timestamp values + of the candlestick item. - The following QML example creates a candlestick series with three candlestick sets (assuming the - model has at least four columns). Each candlestick set would contain data defined by timestamp, - open, high, low and close rows. The name of a set would be defined by the horizontal header of - the column. + Both model and candlestick series properties can be used to manipulate the data. The model + mapper keeps the candlestick series and the data model in sync. + + The model mapper ensures that all the candlestick items in the candlestick series have equal + sizes. Therefore, adding or removing a value from a candlestick item causes the same change to + be made in all the candlestick items in the candlestick series. + + The following QML example creates a candlestick series with three candlestick items (assuming + the model has at least four columns). Each candlestick item contains data defined by the + timestamp, open, high, low, and close rows. The name of an item is defined by the horizontal + header of the column. \qml CandlestickSeries { VCandlestickModelMapper { @@ -77,108 +93,125 @@ QT_CHARTS_BEGIN_NAMESPACE } \endqml - \note VCandlestickModelMapper keeps the series and the model in sync. + \sa CandlestickSeries, CandlestickSet, HCandlestickModelMapper */ /*! \qmlproperty QAbstractItemModel VCandlestickModelMapper::model - \brief The QAbstractItemModel-based model that is used by the mapper. The model must be + The QAbstractItemModel-based model that is used by the mapper. The model must be implemented and exposed to QML. - \note The model used must support adding and removing rows/columns and modifying the data of the - cells. + \note The model used must support adding and removing rows or columns and modifying the data of + the cells. */ /*! \qmlproperty CandlestickSeries VCandlestickModelMapper::series - \brief Defines the CandlestickSeries based object that is used by the mapper. + The CandlestickSeries based object that is used by the mapper. All the data in the series is discarded when it is set to the mapper. When a new series is - specified, the old series is disconnected (preserving its data). + specified, the old series is disconnected (but it preserves its data). */ /*! \property QVCandlestickModelMapper::timestampRow - \brief Defines the row of the model that contains the timestamp values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The row of the model that contains the timestamp values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::timestampRow - \brief Defines the row of the model that contains the timestamp values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The row of the model that contains the timestamp values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QVCandlestickModelMapper::openRow - \brief Defines the row of the model that contains the open values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The row of the model that contains the open values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::openRow - \brief Defines the row of the model that contains the open values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The row of the model that contains the open values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QVCandlestickModelMapper::highRow - \brief Defines the row of the model that contains the high values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The row of the model that contains the high values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::highRow - \brief Defines the row of the model that contains the high values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The row of the model that contains the high values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QVCandlestickModelMapper::lowRow - \brief Defines the row of the model that contains the low values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The row of the model that contains the low values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::lowRow - \brief Defines the row of the model that contains the low values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The row of the model that contains the low values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QVCandlestickModelMapper::closeRow - \brief Defines the row of the model that contains the close values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + \brief The row of the model that contains the close values of the + candlestick items in the series. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::closeRow - \brief Defines the row of the model that contains the close values of the - \l {QCandlestickSet} {QCandlestickSets} in the series. Default value is -1 (invalid mapping). + The row of the model that contains the close values of the + candlestick items in the series. The default value is -1 + (invalid mapping). */ /*! \property QVCandlestickModelMapper::firstSetColumn - \brief Defines the column of the model that is used as the data source for the first set. - Default value is -1 (invalid mapping). + \brief The column of the model that is used as the data source for the first item. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::firstSetColumn - \brief Defines the column of the model that is used as the data source for the first set. - Default value is -1 (invalid mapping). + The column of the model that is used as the data source for the first item. + The default value is -1 (invalid mapping). */ /*! \property QVCandlestickModelMapper::lastSetColumn - \brief Defines the column of the model that is used as the data source for the last set. Default - value is -1 (invalid mapping). + \brief The column of the model that is used as the data source for the last item. + + The default value is -1 (invalid mapping). */ /*! \qmlproperty int VCandlestickModelMapper::lastSetColumn - \brief Defines the column of the model that is used as the data source for the last set. Default - value is -1 (invalid mapping). + The column of the model that is used as the data source for the last item. + The default value is -1 (invalid mapping). */ /*! @@ -213,13 +246,13 @@ QT_CHARTS_BEGIN_NAMESPACE /*! \fn void QVCandlestickModelMapper::firstSetColumnChanged() - \brief Emitted when the column of the model that contains the data of the first set is changed. + \brief Emitted when the column of the model that contains the data of the first item is changed. \sa firstSetColumn */ /*! \fn void QVCandlestickModelMapper::lastSetColumnChanged() - \brief Emitted when the column of the model that contains the data of the last set is changed. + \brief Emitted when the column of the model that contains the data of the last item is changed. \sa lastSetColumn */ @@ -239,7 +272,7 @@ QVCandlestickModelMapper::QVCandlestickModelMapper(QObject *parent) } /*! - Returns Qt::Vertical. This means that values of the set are read from columns. + Returns Qt::Vertical. This means that values of the item are read from columns. */ Qt::Orientation QVCandlestickModelMapper::orientation() const { |