qbarseries_p.h
72 lines
| 1.9 KiB
| text/x-c
|
CLexer
|
r938 | #ifndef QBARSERIES_P_H | ||
#define QBARSERIES_P_H | ||||
|
r934 | |||
#include "qbarseries.h" | ||||
|
r988 | #include "qabstractseries_p.h" | ||
|
r934 | #include <QStringList> | ||
|
r988 | #include <QAbstractSeries> | ||
|
r934 | |||
class QModelIndex; | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r1170 | class QBarModelMapper; | ||
|
r934 | // Container for series | ||
|
r988 | class QBarSeriesPrivate : public QAbstractSeriesPrivate | ||
|
r934 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r1167 | QBarSeriesPrivate(QBarSeries *parent); | ||
|
r1112 | void setCategories(QBarCategories categories); | ||
|
r1208 | void insertCategory(int index, const QString category); | ||
void removeCategory(int index); | ||||
int categoryCount() const; | ||||
QBarCategories categories() const; | ||||
|
r1167 | void setBarMargin(qreal margin); | ||
qreal barMargin(); | ||||
|
r934 | |||
|
r943 | void scaleDomain(Domain& domain); | ||
Chart* createGraphics(ChartPresenter* presenter); | ||||
|
r950 | QList<LegendMarker*> createLegendMarker(QLegend* legend); | ||
|
r943 | |||
|
r934 | QBarSet* barsetAt(int index); | ||
QString categoryName(int category); | ||||
qreal min(); | ||||
qreal max(); | ||||
qreal valueAt(int set, int category); | ||||
qreal percentageAt(int set, int category); | ||||
qreal categorySum(int category); | ||||
qreal absoluteCategorySum(int category); | ||||
qreal maxCategorySum(); | ||||
Q_SIGNALS: | ||||
|
r1008 | void clicked(QBarSet *barset, QString category); | ||
|
r934 | void updatedBars(); | ||
void restructuredBars(); | ||||
|
r1056 | void categoriesUpdated(); | ||
|
r934 | |||
private Q_SLOTS: | ||||
// slots for updating bars when data in model changes | ||||
|
r1170 | void modelUpdated(QModelIndex topLeft, QModelIndex bottomRight); | ||
|
r1056 | void modelDataAdded(QModelIndex parent, int start, int end); | ||
void modelDataRemoved(QModelIndex parent, int start, int end); | ||||
|
r1170 | void initializeDataFromModel(); | ||
|
r934 | void barsetChanged(); | ||
protected: | ||||
|
r1005 | QList<QBarSet *> m_barSets; | ||
QBarCategories m_categories; | ||||
|
r1171 | qreal m_barMargin; | ||
int m_mapCategories; | ||||
int m_mapBarBottom; | ||||
int m_mapBarTop; | ||||
|
r1170 | QBarModelMapper *m_mapper; | ||
|
r938 | private: | ||
Q_DECLARE_PUBLIC(QBarSeries) | ||||
|
r934 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSERIESPRIVATE_P_H | ||||