diff --git a/src/qchart.cpp b/src/qchart.cpp index 2d60157..e6df871 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -32,7 +32,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - Constructs a chart object which is a child of a\a parent. + Constructs a chart object which is a child of a\a parent. Parameter \a wFlags is passed to the QGraphicsWidget constructor. */ QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsWidget(parent,wFlags), m_backgroundItem(0), @@ -80,6 +80,9 @@ void QChart::removeAllSeries() m_dataset->removeAllSeries(); } +/*! + Sets the \a brush that is used for painting the background of the chart area. +*/ void QChart::setChartBackgroundBrush(const QBrush& brush) { createChartBackgroundItem(); @@ -87,6 +90,9 @@ void QChart::setChartBackgroundBrush(const QBrush& brush) m_backgroundItem->update(); } +/*! + Sets the \a pen that is used for painting the background of the chart area. +*/ void QChart::setChartBackgroundPen(const QPen& pen) { createChartBackgroundItem(); @@ -199,6 +205,9 @@ void QChart::zoomOut() m_dataset->previousDomain(); } +/*! + Resets to the default view. +*/ void QChart::zoomReset() { m_dataset->clearDomains(); @@ -220,6 +229,9 @@ QChartAxis* QChart::axisY() const return m_dataset->axisY(); } +/*! + Resizes and updates the chart area using the \a event data +*/ void QChart::resizeEvent(QGraphicsSceneResizeEvent *event) { diff --git a/src/qchartview.cpp b/src/qchartview.cpp index ed9e204..5b41cde 100644 --- a/src/qchartview.cpp +++ b/src/qchartview.cpp @@ -8,10 +8,21 @@ #include /*! + \enum QChartView::RubberBandPolicy + + This enum describes the different types of rubber bands that can be used for zoom rect selection + + \value NoRubberBand + \value VerticalRubberBand + \value HorizonalRubberBand + \value RectangleRubberBand +*/ + +/*! \class QChartView - \brief Chart widget + \brief Standalone charting widget. - QChartView is a standalone widget that can display charts. It does not require QGraphicsScene to work. It manages the graphical + QChartView is a standalone widget that can display charts. It does not require separate QGraphicsScene to work. It manages the graphical representation of different types of QChartSeries and other chart related objects like QChartAxis and QChartLegend. If you want to display a chart in your existing QGraphicsScene, you can use the QChart class instead. @@ -47,6 +58,9 @@ QChartView::~QChartView() { } +/*! + Resizes and updates the chart area using the \a event data +*/ void QChartView::resizeEvent(QResizeEvent *event) { m_scene->setSceneRect(0,0,size().width(),size().height()); @@ -195,7 +209,7 @@ QChartView::RubberBandPolicy QChartView::rubberBandPolicy() const /*! If Left mouse button is pressed and the RubberBandPolicy is enabled the \a event is accepted and the rubber band is displayed on the screen allowing the user to select the zoom area. - If different mouse button is pressed and/or the RubberBandPolicy is disabled then the \a event is not consumed. + If different mouse button is pressed and/or the RubberBandPolicy is disabled then the \a event is passed to QGraphicsView::mousePressEvent() implementation is called. */ void QChartView::mousePressEvent(QMouseEvent *event) { @@ -216,6 +230,10 @@ void QChartView::mousePressEvent(QMouseEvent *event) } } +/*! + If RubberBand rectange specification has been initiated in pressEvent then \a event data is used to update RubberBand geometry. + In other case the defualt QGraphicsView::mouseMoveEvent implementation is called. +*/ void QChartView::mouseMoveEvent(QMouseEvent *event) { if(m_rubberBand && m_rubberBand->isVisible()) { @@ -260,6 +278,10 @@ void QChartView::mouseReleaseEvent(QMouseEvent *event) } } +/*! + Pressing + and - keys performs zoomIn() and zoomOut() respectivly. + In other \a event is passed to the QGraphicsView::keyPressEvent() implementation +*/ void QChartView::keyPressEvent(QKeyEvent *event) { switch (event->key()) {