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