diff --git a/src/barchart/qbarmodelmapper.cpp b/src/barchart/qbarmodelmapper.cpp index a4b53a9..bb95d71 100644 --- a/src/barchart/qbarmodelmapper.cpp +++ b/src/barchart/qbarmodelmapper.cpp @@ -9,6 +9,45 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! + \property QBarModelMapper::series + \brief Defines the QPieSeries object that is used by the mapper. + + All the data in the series 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 QBarModelMapper::model + \brief Defines the model that is used by the mapper. +*/ + +/*! + \property QBarModelMapper::first + \brief Defines which item of the model's row/column should be mapped as the value of the first QBarSet in the series. + + Minimal and default value is: 0 +*/ + +/*! + \property QBarModelMapper::count + \brief Defines the number of rows/columns of the model that are mapped as the data for QBarSeries + + Minimal and default value is: -1 (count limited by the number of rows/columns in the model) +*/ + +/*! + \class QBarModelMapper + \brief part of QtCommercial chart API. + \mainclass + + The instance of this class cannot be created directly. QHBarModelMapper of QVBarModelMapper should be used instead. This class is used to create a connection between QBarSeries and QAbstractItemModel derived model object. + Curently it is NOT possible to use both QAbstractItemModel and QXYSeries model API. + When the series is set to the mapper the QBarSeries and QBarSet API that affect the data (append, setValue, remove) should not be used. + The model and the QBarSeries won't be kept in sync. Model API should be used to insert,remove,modify BarSets. + NOTE: used model has to support adding/removing rows/columns and modifying the data of the cells. +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QBarModelMapper::QBarModelMapper(QObject *parent) : @@ -93,12 +132,22 @@ void QBarModelMapper::setCount(int count) d->initializeBarFromModel(); } +/*! + Returns the orientation that is used when QBarModelMapper accesses the model. + This mean whether the consecutive values of the bar set are read from row (Qt::Horizontal) + or from columns (Qt::Vertical) +*/ Qt::Orientation QBarModelMapper::orientation() const { Q_D(const QBarModelMapper); return d->m_orientation; } +/*! + Returns the \a orientation that is used when QBarModelMapper accesses the model. + This mean whether the consecutive values of the pie are read from row (Qt::Horizontal) + or from columns (Qt::Vertical) +*/ void QBarModelMapper::setOrientation(Qt::Orientation orientation) { Q_D(QBarModelMapper); @@ -106,12 +155,19 @@ void QBarModelMapper::setOrientation(Qt::Orientation orientation) d->initializeBarFromModel(); } +/*! + Returns which section of the model is used as the data source for the first bar set +*/ int QBarModelMapper::firstBarSetSection() const { Q_D(const QBarModelMapper); return d->m_firstBarSetSection; } +/*! + Sets the model section that is used as the data source for the first bar set + Parameter \a firstBarSetSection specifies the section of the model. +*/ void QBarModelMapper::setFirstBarSetSection(int firstBarSetSection) { Q_D(QBarModelMapper); @@ -119,12 +175,19 @@ void QBarModelMapper::setFirstBarSetSection(int firstBarSetSection) d->initializeBarFromModel(); } +/*! + Returns which section of the model is used as the data source for the last bar set +*/ int QBarModelMapper::lastBarSetSection() const { Q_D(const QBarModelMapper); return d->m_lastBarSetSection; } +/*! + Sets the model section that is used as the data source for the last bar set + Parameter \a lastBarSetSection specifies the section of the model. +*/ void QBarModelMapper::setLastBarSetSection(int lastBarSetSection) { Q_D(QBarModelMapper); @@ -132,12 +195,19 @@ void QBarModelMapper::setLastBarSetSection(int lastBarSetSection) d->initializeBarFromModel(); } +/*! + Returns which section of the model is used as the data source for the x axis categories. +*/ int QBarModelMapper::categoriesSection() const { Q_D(const QBarModelMapper); return d->m_categoriesSection; } +/*! + Sets the model section that is used as the data source for the x axis categories. + Parameter \a categoriesSection specifies the section of the model. +*/ void QBarModelMapper::setCategoriesSection(int categoriesSection) { Q_D(QBarModelMapper); @@ -145,6 +215,10 @@ void QBarModelMapper::setCategoriesSection(int categoriesSection) d->initializeBarFromModel(); } +/*! + Resets the QBarModelMapper to the default state. + first: 0; count: -1; firstBarSetSection: -1; lastBarSetSection: -1; categoriesSection: -1 +*/ void QBarModelMapper::reset() { Q_D(QBarModelMapper); diff --git a/src/barchart/qbarmodelmapper.h b/src/barchart/qbarmodelmapper.h index c5f9c3c..d7c2dd9 100644 --- a/src/barchart/qbarmodelmapper.h +++ b/src/barchart/qbarmodelmapper.h @@ -52,9 +52,6 @@ protected: Qt::Orientation orientation() const; void setOrientation(Qt::Orientation orientation); -Q_SIGNALS: - void updated(); - protected: QBarModelMapperPrivate * const d_ptr; Q_DECLARE_PRIVATE(QBarModelMapper) diff --git a/src/barchart/qhbarmodelmapper.cpp b/src/barchart/qhbarmodelmapper.cpp index c2a63ad..6f6f48c 100644 --- a/src/barchart/qhbarmodelmapper.cpp +++ b/src/barchart/qhbarmodelmapper.cpp @@ -11,6 +11,27 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QHBarModelMapper::firstBarSetRow + \brief Defines which column of the model is used as the data source for the first bar set + + Default value is: -1 (invalid mapping) +*/ + +/*! + \property QHBarModelMapper::lastBarSetRow + \brief Defines which column of the model is used as the data source for the last bar set + + Default value is: -1 (invalid mapping) +*/ + +/*! + \property QHBarModelMapper::categoriesRow + \brief Defines which row of the model is used as the data source for the x axis categories + + Default value is: -1 (invalid mapping) +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QHBarModelMapper::QHBarModelMapper(QObject *parent) : diff --git a/src/barchart/qvbarmodelmapper.cpp b/src/barchart/qvbarmodelmapper.cpp index fbfa780..acf4598 100644 --- a/src/barchart/qvbarmodelmapper.cpp +++ b/src/barchart/qvbarmodelmapper.cpp @@ -11,6 +11,27 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \property QVBarModelMapper::firstBarSetColumn + \brief Defines which column of the model is used as the data source for the first bar set + + Default value is: -1 (invalid mapping) +*/ + +/*! + \property QVBarModelMapper::lastBarSetColumn + \brief Defines which column of the model is used as the data source for the last bar set + + Default value is: -1 (invalid mapping) +*/ + +/*! + \property QVBarModelMapper::categoriesColumn + \brief Defines which column of the model is used as the data source for the x axis categories + + Default value is: -1 (invalid mapping) +*/ + +/*! Constructs a mapper object which is a child of \a parent. */ QVBarModelMapper::QVBarModelMapper(QObject *parent) :