qbarseries.h
78 lines
| 2.3 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r338 | #ifndef BARSERIES_H | ||
#define BARSERIES_H | ||||
|
r56 | |||
|
r988 | #include <qabstractseries.h> | ||
|
r377 | #include <QStringList> | ||
|
r74 | |||
|
r877 | class QModelIndex; | ||
|
r56 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r703 | typedef QStringList QBarCategories; | ||
|
r701 | |||
|
r172 | class QBarSet; | ||
|
r412 | class BarCategory; | ||
|
r934 | class QBarSeriesPrivate; | ||
|
r172 | |||
|
r56 | // Container for series | ||
|
r988 | class QTCOMMERCIALCHART_EXPORT QBarSeries : public QAbstractSeries | ||
|
r56 | { | ||
|
r71 | Q_OBJECT | ||
|
r56 | public: | ||
|
r970 | explicit QBarSeries(QBarCategories categories, QObject *parent = 0); | ||
|
r980 | virtual ~QBarSeries(); | ||
|
r56 | |||
|
r988 | QAbstractSeries::QSeriesType type() const; | ||
|
r56 | |||
|
r850 | void appendBarSet(QBarSet *set); // Takes ownership of set | ||
|
r280 | void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set | ||
|
r850 | void appendBarSets(QList<QBarSet* > sets); | ||
void removeBarSets(QList<QBarSet* > sets); | ||||
|
r776 | int barsetCount() const; | ||
int categoryCount() const; | ||||
QList<QBarSet*> barSets() const; | ||||
|
r703 | QBarCategories categories() const; | ||
|
r820 | void setLabelsVisible(bool visible = true); | ||
|
r813 | |||
|
r737 | bool setModel(QAbstractItemModel *model); | ||
|
r934 | void setModelMapping(int categories, int bottomBoundary, int topBoundary, Qt::Orientation orientation = Qt::Vertical); | ||
|
r1056 | void setModelMappingRange(int first, int count = -1); | ||
|
r527 | |||
|
r943 | protected: | ||
explicit QBarSeries(QBarSeriesPrivate &d,QObject *parent = 0); | ||||
|
r775 | Q_SIGNALS: | ||
|
r1008 | void clicked(QBarSet *barset, QString category); | ||
|
r975 | void hovered(QBarSet* barset, bool status); | ||
|
r171 | |||
|
r281 | protected: | ||
|
r934 | Q_DECLARE_PRIVATE(QBarSeries) | ||
|
r962 | friend class BarChartItem; | ||
friend class PercentBarChartItem; | ||||
friend class StackedBarChartItem; | ||||
|
r56 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r338 | #endif // BARSERIES_H | ||