qchart.h
85 lines
| 2.0 KiB
| text/x-c
|
CLexer
/ src / qchart.h
|
r12 | #ifndef CHART_H | ||
#define CHART_H | ||||
|
r30 | #include <qchartglobal.h> | ||
|
r42 | #include <qchartseries.h> | ||
|
r115 | #include <QGraphicsWidget> | ||
|
r69 | #include <QLinearGradient> | ||
|
r87 | #include <QFont> | ||
|
r12 | |||
|
r115 | class QGraphicsSceneResizeEvent; | ||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r12 | |||
|
r67 | class AxisItem; | ||
|
r21 | class QChartSeries; | ||
|
r67 | class PlotDomain; | ||
|
r216 | class BarPresenter; | ||
|
r72 | class QChartAxis; | ||
|
r103 | class ChartTheme; | ||
|
r108 | class ChartItem; | ||
|
r131 | class ChartDataSet; | ||
class ChartPresenter; | ||||
|
r21 | |||
|
r42 | /*! | ||
* TODO: define the responsibilities | ||||
*/ | ||||
|
r115 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget | ||
|
r38 | { | ||
|
r48 | Q_OBJECT | ||
|
r64 | public: | ||
|
r153 | enum ChartTheme { | ||
|
r81 | /*! The default theme follows the GUI style of the Operating System */ | ||
|
r103 | ChartThemeDefault, | ||
|
r81 | ChartThemeVanilla, | ||
|
r64 | ChartThemeIcy, | ||
|
r77 | ChartThemeGrayscale, | ||
|
r125 | ChartThemeScientific, | ||
|
r143 | //ChartThemeUnnamed1 | ||
|
r64 | }; | ||
|
r12 | public: | ||
|
r115 | QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); | ||
|
r48 | ~QChart(); | ||
|
r12 | |||
|
r258 | void addSeries(QChartSeries* series,QChartAxis* axisY=0);// takes series ownership , takes axis ownership | ||
void removeSeries(QChartSeries* series); //returns ownership , deletes axis if no series attached | ||||
void removeAllSeries(); // deletes series and axis | ||||
|
r12 | |||
void setMargin(int margin); | ||||
|
r28 | int margin() const; | ||
|
r153 | void setChartTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme chartTheme() const; | ||||
|
r28 | |||
|
r192 | void setChartTitle(const QString& title); | ||
void setChartTitleFont(const QFont& font); | ||||
|
r122 | void setChartBackgroundBrush(const QBrush& brush); | ||
void setChartBackgroundPen(const QPen& pen); | ||||
|
r67 | void zoomIn(); | ||
|
r223 | void zoomIn(const QRectF& rect); | ||
|
r67 | void zoomOut(); | ||
|
r93 | void zoomReset(); | ||
|
r67 | |||
|
r223 | QChartAxis* axisX() const; | ||
QChartAxis* axisY() const; | ||||
|
r72 | |||
|
r115 | protected: | ||
void resizeEvent(QGraphicsSceneResizeEvent *event); | ||||
|
r223 | private: | ||
inline void createChartBackgroundItem(); | ||||
inline void createChartTitleItem(); | ||||
|
r12 | private: | ||
|
r28 | Q_DISABLE_COPY(QChart) | ||
|
r87 | QGraphicsRectItem* m_backgroundItem; | ||
QGraphicsTextItem* m_titleItem; | ||||
|
r115 | QRectF m_rect; | ||
|
r131 | ChartDataSet *m_dataset; | ||
ChartPresenter *m_presenter; | ||||
|
r12 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r12 | |||
#endif | ||||