qchart.h
102 lines
| 2.5 KiB
| text/x-c
|
CLexer
/ src / qchart.h
|
r264 | #ifndef QCHART_H | ||
#define QCHART_H | ||||
|
r12 | |||
|
r30 | #include <qchartglobal.h> | ||
|
r360 | #include <qseries.h> | ||
|
r115 | #include <QGraphicsWidget> | ||
|
r69 | #include <QLinearGradient> | ||
|
r87 | #include <QFont> | ||
|
r12 | |||
|
r115 | class QGraphicsSceneResizeEvent; | ||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r12 | |||
|
r67 | class AxisItem; | ||
|
r360 | class QSeries; | ||
|
r67 | class PlotDomain; | ||
|
r216 | class BarPresenter; | ||
|
r72 | class QChartAxis; | ||
|
r103 | class ChartTheme; | ||
|
r108 | class ChartItem; | ||
|
r131 | class ChartDataSet; | ||
class ChartPresenter; | ||||
|
r524 | class QLegend; | ||
|
r21 | |||
|
r115 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget | ||
|
r38 | { | ||
|
r48 | Q_OBJECT | ||
|
r64 | public: | ||
|
r298 | enum ChartTheme { | ||
|
r103 | ChartThemeDefault, | ||
|
r81 | ChartThemeVanilla, | ||
|
r64 | ChartThemeIcy, | ||
|
r77 | ChartThemeGrayscale, | ||
|
r264 | ChartThemeScientific | ||
|
r143 | //ChartThemeUnnamed1 | ||
|
r285 | /*! The default theme follows the GUI style of the Operating System */ | ||
|
r64 | }; | ||
|
r298 | enum AnimationOption { | ||
NoAnimation = 0x0, | ||||
GridAxisAnimations = 0x1, | ||||
SeriesAnimations =0x2, | ||||
AllAnimations = 0x3 | ||||
}; | ||||
Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) | ||||
|
r12 | public: | ||
|
r115 | QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); | ||
|
r48 | ~QChart(); | ||
|
r12 | |||
|
r360 | void addSeries(QSeries* series, QChartAxis* axisY = 0); | ||
void removeSeries(QSeries* series); //returns ownership , deletes axis if no series attached | ||||
|
r258 | 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); | ||
|
r476 | QString chartTitle() const; | ||
|
r192 | void setChartTitleFont(const QFont& font); | ||
|
r495 | void setChartTitleBrush(const QBrush &brush); | ||
QBrush chartTitleBrush(); | ||||
|
r122 | void setChartBackgroundBrush(const QBrush& brush); | ||
void setChartBackgroundPen(const QPen& pen); | ||||
|
r298 | void setAnimationOptions(AnimationOptions options); | ||
AnimationOptions animationOptions() const; | ||||
|
r67 | void zoomIn(); | ||
|
r223 | void zoomIn(const QRectF& rect); | ||
|
r67 | void zoomOut(); | ||
|
r93 | void zoomReset(); | ||
|
r67 | |||
|
r223 | QChartAxis* axisX() const; | ||
QChartAxis* axisY() const; | ||||
|
r72 | |||
|
r524 | QLegend* legend() const; | ||
|
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; | ||
|
r476 | QGraphicsSimpleTextItem* m_titleItem; | ||
|
r115 | QRectF m_rect; | ||
|
r131 | ChartDataSet *m_dataset; | ||
ChartPresenter *m_presenter; | ||||
|
r524 | QLegend* m_legend; | ||
|
r12 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r12 | |||
|
r298 | Q_DECLARE_OPERATORS_FOR_FLAGS(QTCOMMERCIALCHART_NAMESPACE::QChart::AnimationOptions) | ||
|
r12 | #endif | ||