From 704deaf5754b96a9d4e0898839352a8dc5fbe2f4 2012-02-22 13:48:00 From: Marek Rosa Date: 2012-02-22 13:48:00 Subject: [PATCH] Added some more documentation to QChart and QChartView --- diff --git a/src/qchart.cpp b/src/qchart.cpp index 522e2b6..479b130 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -6,6 +6,20 @@ #include #include +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +/*! + \enum QChart::ChartTheme + + This enum describes the theme used by the chart. + + \value ChartThemeDefault + \value ChartThemeVanilla + \value ChartThemeIcy + \value ChartThemeGrayscale + \value ChartThemeScientific +*/ + /*! \class QChart \brief QtCommercial chart API. @@ -17,8 +31,6 @@ \sa QChartView */ -QTCOMMERCIALCHART_BEGIN_NAMESPACE - /*! Constructs a chart object which is a child of parent. */ @@ -38,7 +50,7 @@ QChart::~QChart() } /*! - Adds the series and optional y axis onto the chart and takes the ownership of the objects. + Adds the \a series and optional y axis onto the chart and takes the ownership of the objects. If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and the y axis). */ @@ -83,7 +95,7 @@ void QChart::setChartBackgroundPen(const QPen& pen) } /*! - Sets the title description text that is rendered above the chart. + Sets the chart \a title. The description text that is rendered above the chart. */ void QChart::setChartTitle(const QString& title) { @@ -92,7 +104,7 @@ void QChart::setChartTitle(const QString& title) } /*! - Sets the font that is used for rendering the description text that is rendered above the chart. + Sets the \a font that is used for rendering the description text that is rendered above the chart. */ void QChart::setChartTitleFont(const QFont& font) { @@ -117,21 +129,37 @@ void QChart::createChartTitleItem() } } +/*! + Returns the chart margin, which is the distance between the widget edge and the part of the chart where the actual data can be displayed. + \sa setMargin() +*/ int QChart::margin() const { return m_presenter->margin(); } +/*! + Sets the chart \a margin, which is the distance between the widget edge and the part of the chart where the actual data can be displayed. + \sa margin() +*/ void QChart::setMargin(int margin) { m_presenter->setMargin(margin); } +/*! + Sets the \a theme used by the chart for rendering data graphical representation + \sa ChartTheme, chartTheme() +*/ void QChart::setChartTheme(QChart::ChartTheme theme) { m_presenter->setChartTheme(theme); } +/*! + Returns the theme enum used by the chart. + \sa ChartTheme, setChartTheme() +*/ QChart::ChartTheme QChart::chartTheme() const { return m_presenter->chartTheme(); @@ -167,11 +195,17 @@ void QChart::zoomReset() m_dataset->clearDomains(); } +/*! + Returns the pointer to the x axis object of the chart +*/ QChartAxis* QChart::axisX() const { return m_dataset->axisX(); } +/*! + Returns the pointer to the y axis object of the chart +*/ QChartAxis* QChart::axisY() const { return m_dataset->axisY(); diff --git a/src/qchartview.cpp b/src/qchartview.cpp index 5a3b50a..ddb825a 100644 --- a/src/qchartview.cpp +++ b/src/qchartview.cpp @@ -36,6 +36,10 @@ m_horizonalRubberBand(false) setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } + +/*! + Destroys the object and it's children, like QChartSeries and QChartAxis object added to it. +*/ QChartView::~QChartView() { } @@ -95,7 +99,7 @@ void QChartView::zoomOut() } /*! - Returns the chart margin, which is the distance between the widget edge and the axis lines or the chart. + Returns the chart margin, which is the distance between the widget edge and the part of the chart where the actual data can be displayed. */ int QChartView::margin() const { @@ -103,7 +107,7 @@ int QChartView::margin() const } /*! - Sets the title description text that is rendered above the chart. + Sets the chart \a tile. A description text that is rendered above the chart. */ void QChartView::setChartTitle(const QString& title) { @@ -111,17 +115,24 @@ void QChartView::setChartTitle(const QString& title) } /*! - Sets the font that is used for rendering the description text that is rendered above the chart. + Sets the \a font that is used for rendering the description text that is rendered above the chart. */ void QChartView::setChartTitleFont(const QFont& font) { m_chart->setChartTitleFont(font); } +/*! + Sets the \a brush that is used for painting the background of the chart area of the QChartView widget. +*/ void QChartView::setChartBackgroundBrush(const QBrush& brush) { m_chart->setChartBackgroundBrush(brush); } + +/*! + Sets the \a pen that is used for painting the background of the chart area of the QChartView widget. +*/ void QChartView::setChartBackgroundPen(const QPen& pen) { m_chart->setChartBackgroundPen(pen); @@ -235,11 +246,19 @@ void QChartView::keyPressEvent(QKeyEvent *event) } } +/*! + Sets the \a theme used by the chart for rendering the graphical representation of the data + \sa QChart::ChartTheme, chartTheme() +*/ void QChartView::setChartTheme(QChart::ChartTheme theme) { m_chart->setChartTheme(theme); } +/*! + Returns the theme enum used by the chart. + \sa setChartTheme() +*/ QChart::ChartTheme QChartView::chartTheme() const { return m_chart->chartTheme();