##// END OF EJS Templates
QChart and QChartView now has some description for all the functions
Marek Rosa -
r287:6e151fb989cd
parent child
Show More
@@ -32,7 +32,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32 32 */
33 33
34 34 /*!
35 Constructs a chart object which is a child of a\a parent.
35 Constructs a chart object which is a child of a\a parent. Parameter \a wFlags is passed to the QGraphicsWidget constructor.
36 36 */
37 37 QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsWidget(parent,wFlags),
38 38 m_backgroundItem(0),
@@ -80,6 +80,9 void QChart::removeAllSeries()
80 80 m_dataset->removeAllSeries();
81 81 }
82 82
83 /*!
84 Sets the \a brush that is used for painting the background of the chart area.
85 */
83 86 void QChart::setChartBackgroundBrush(const QBrush& brush)
84 87 {
85 88 createChartBackgroundItem();
@@ -87,6 +90,9 void QChart::setChartBackgroundBrush(const QBrush& brush)
87 90 m_backgroundItem->update();
88 91 }
89 92
93 /*!
94 Sets the \a pen that is used for painting the background of the chart area.
95 */
90 96 void QChart::setChartBackgroundPen(const QPen& pen)
91 97 {
92 98 createChartBackgroundItem();
@@ -199,6 +205,9 void QChart::zoomOut()
199 205 m_dataset->previousDomain();
200 206 }
201 207
208 /*!
209 Resets to the default view.
210 */
202 211 void QChart::zoomReset()
203 212 {
204 213 m_dataset->clearDomains();
@@ -220,6 +229,9 QChartAxis* QChart::axisY() const
220 229 return m_dataset->axisY();
221 230 }
222 231
232 /*!
233 Resizes and updates the chart area using the \a event data
234 */
223 235 void QChart::resizeEvent(QGraphicsSceneResizeEvent *event)
224 236 {
225 237
@@ -8,10 +8,21
8 8 #include <QDebug>
9 9
10 10 /*!
11 \enum QChartView::RubberBandPolicy
12
13 This enum describes the different types of rubber bands that can be used for zoom rect selection
14
15 \value NoRubberBand
16 \value VerticalRubberBand
17 \value HorizonalRubberBand
18 \value RectangleRubberBand
19 */
20
21 /*!
11 22 \class QChartView
12 \brief Chart widget
23 \brief Standalone charting widget.
13 24
14 QChartView is a standalone widget that can display charts. It does not require QGraphicsScene to work. It manages the graphical
25 QChartView is a standalone widget that can display charts. It does not require separate QGraphicsScene to work. It manages the graphical
15 26 representation of different types of QChartSeries and other chart related objects like
16 27 QChartAxis and QChartLegend. If you want to display a chart in your existing QGraphicsScene, you can use the QChart class instead.
17 28
@@ -47,6 +58,9 QChartView::~QChartView()
47 58 {
48 59 }
49 60
61 /*!
62 Resizes and updates the chart area using the \a event data
63 */
50 64 void QChartView::resizeEvent(QResizeEvent *event)
51 65 {
52 66 m_scene->setSceneRect(0,0,size().width(),size().height());
@@ -195,7 +209,7 QChartView::RubberBandPolicy QChartView::rubberBandPolicy() const
195 209
196 210 /*!
197 211 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.
198 If different mouse button is pressed and/or the RubberBandPolicy is disabled then the \a event is not consumed.
212 If different mouse button is pressed and/or the RubberBandPolicy is disabled then the \a event is passed to QGraphicsView::mousePressEvent() implementation is called.
199 213 */
200 214 void QChartView::mousePressEvent(QMouseEvent *event)
201 215 {
@@ -216,6 +230,10 void QChartView::mousePressEvent(QMouseEvent *event)
216 230 }
217 231 }
218 232
233 /*!
234 If RubberBand rectange specification has been initiated in pressEvent then \a event data is used to update RubberBand geometry.
235 In other case the defualt QGraphicsView::mouseMoveEvent implementation is called.
236 */
219 237 void QChartView::mouseMoveEvent(QMouseEvent *event)
220 238 {
221 239 if(m_rubberBand && m_rubberBand->isVisible()) {
@@ -260,6 +278,10 void QChartView::mouseReleaseEvent(QMouseEvent *event)
260 278 }
261 279 }
262 280
281 /*!
282 Pressing + and - keys performs zoomIn() and zoomOut() respectivly.
283 In other \a event is passed to the QGraphicsView::keyPressEvent() implementation
284 */
263 285 void QChartView::keyPressEvent(QKeyEvent *event)
264 286 {
265 287 switch (event->key()) {
General Comments 0
You need to be logged in to leave comments. Login now