qbarcategory.cpp
56 lines
| 1.1 KiB
| text/x-c
|
CppLexer
|
r169 | #include "qbarcategory.h" | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r297 | /*! | ||
\class QBarCategory | ||||
|
r313 | \brief part of QtCommercial chart API. | ||
|
r297 | |||
QBarCategory is a container for labels of various bar charts. Before the | ||||
bar chart can be constructed, the categories must be defined. This is done by | ||||
creating a QBarCategory class and appending the labels of categories to it. | ||||
|
r313 | The QBarCategory is then given to bar chart series class. | ||
|
r319 | \mainclass | ||
Example on how to create a category: | ||||
\snippet ../example/barchart/main.cpp 1 | ||||
|
r338 | \sa QBarSeries, QStackedBarSeries, QPercentBarSeries | ||
|
r297 | */ | ||
/*! | ||||
Constructs the category container | ||||
*/ | ||||
|
r169 | QBarCategory::QBarCategory() | ||
{ | ||||
} | ||||
|
r297 | /*! | ||
Appends the \a label in the category. | ||||
*/ | ||||
|
r169 | QBarCategory& QBarCategory::operator << (const QString &label) | ||
{ | ||||
mList.append(label); | ||||
return *this; | ||||
} | ||||
|
r297 | /*! | ||
Retrurns number of labels in category | ||||
*/ | ||||
|
r169 | int QBarCategory::count() | ||
{ | ||||
return mList.count(); | ||||
} | ||||
|
r297 | /*! | ||
Retruns the label of category defined by index \a category | ||||
*/ | ||||
|
r172 | QString QBarCategory::label(int category) | ||
|
r169 | { | ||
|
r172 | return mList.at(category); | ||
|
r169 | } | ||
|
r173 | // TODO?: | ||
//#include "moc_qbarcategory.cpp" | ||||
|
r169 | QTCOMMERCIALCHART_END_NAMESPACE | ||