From a2d7c580728df654efc85d0c54de76eeef563fb0 2012-02-24 15:12:45 From: sauimone Date: 2012-02-24 15:12:45 Subject: [PATCH] exposing countcategories to user from barchartseries --- diff --git a/src/barchart/qbarchartseries.cpp b/src/barchart/qbarchartseries.cpp index f9fe16b..cd7ccf2 100644 --- a/src/barchart/qbarchartseries.cpp +++ b/src/barchart/qbarchartseries.cpp @@ -55,6 +55,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! Constructs empty QBarChartSeries. Parameter \a category defines the categories for chart. + Takes ownership of \a category. QBarChartSeries is QObject which is a child of a \a parent. */ QBarChartSeries::QBarChartSeries(QBarCategory *category, QObject *parent) @@ -88,6 +89,14 @@ int QBarChartSeries::countSets() } /*! + Returns number of categories in series +*/ +int QBarChartSeries::countCategories() +{ + return mModel->countCategories(); +} + +/*! Simple iterator for set. Returns pointer to next set in series. Returns first set, if parameter \a getFirst is true. If series is empty, returns 0. @@ -177,14 +186,6 @@ void QBarChartSeries::enableSeparators(bool enabled) /*! \internal */ -int QBarChartSeries::countCategories() -{ - return mModel->countCategories(); -} - -/*! - \internal -*/ qreal QBarChartSeries::min() { return mModel->min(); diff --git a/src/barchart/qbarchartseries.h b/src/barchart/qbarchartseries.h index 5262ed2..e3db2be 100644 --- a/src/barchart/qbarchartseries.h +++ b/src/barchart/qbarchartseries.h @@ -21,6 +21,7 @@ public: void addBarSet(QBarSet *set); // Takes ownership of set void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set int countSets(); + int countCategories(); QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true QBarSet *setAt(int index); @@ -31,7 +32,6 @@ public: // to private implementation, when we start using it // TODO: TO PIMPL ---> QString label(int category); - int countCategories(); qreal min(); qreal max(); qreal valueAt(int set, int category);