##// END OF EJS Templates
Started documenting QChart
Tero Ahola -
r264:98bded228a4b
parent child
Show More
@@ -16,10 +16,10 HTML.templatedir = .
16 HTML.stylesheets = style/offline.css
16 HTML.stylesheets = style/offline.css
17 HTML.headerstyles = \
17 HTML.headerstyles = \
18 " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
18 " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
19 sources.fileextensions = "*.cpp *.qdoc *.mm *.qml"
19 sources.fileextensions = *.cpp *.qdoc *.mm *.qml
20 headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx"
20 headers.fileextensions = *.h *.ch *.h++ *.hh *.hpp *.hxx
21 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
21 examples.fileextensions = *.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml
22 examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng"
22 examples.imageextensions = *.png *.jpeg *.jpg *.gif *.mng
23 imagedirs = ./images
23 imagedirs = ./images
24 outputdir = ./html
24 outputdir = ./html
25
25
@@ -1,6 +1,7
1 /*!
1 /*!
2 \class Widget
2 \class Widget
3 \brief Ui for the application.
3 \brief Ui for the application.
4 \internal
4 */
5 */
5
6
6 #include "widget.h"
7 #include "widget.h"
@@ -6,21 +6,44
6 #include <QGraphicsSceneResizeEvent>
6 #include <QGraphicsSceneResizeEvent>
7 #include <QDebug>
7 #include <QDebug>
8
8
9 /*!
10 \class QChart
11 \brief QtCommercial chart API.
12
13 QChart is a QGraphicsWidget that you can show in a QGraphicsScene. It manages the graphical
14 representation of different types of QChartSeries and other chart related objects like
15 QChartAxis and QChartLegend. If you simply want to show a chart in a layout, you can use the
16 convenience class QChartView instead of QChart.
17 */
18
9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
19 QTCOMMERCIALCHART_BEGIN_NAMESPACE
10
20
21 /*!
22 Constructs a chart object which is a child of parent.
23 */
11 QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsWidget(parent,wFlags),
24 QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsWidget(parent,wFlags),
12 m_backgroundItem(0),
25 m_backgroundItem(0),
13 m_titleItem(0),
26 m_titleItem(0),
14 m_dataset(new ChartDataSet(this)),
27 m_dataset(new ChartDataSet(this)),
15 m_presenter(new ChartPresenter(this,m_dataset))
28 m_presenter(new ChartPresenter(this,m_dataset))
16 {
29 {
17 }
30 }
18
31
19 QChart::~QChart() {}
32 /*!
33 Destroys the object and it's children, like QChartSeries and QChartAxis object added to it.
34 */
35 QChart::~QChart()
36 {
37 }
20
38
21 void QChart::addSeries(QChartSeries* series,QChartAxis* axisY)
39 /*!
40 Adds the series and optional y axis onto the chart and takes the ownership of the objects.
41 If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and
42 the y axis).
43 */
44 void QChart::addSeries(QChartSeries* series, QChartAxis* axisY)
22 {
45 {
23 m_dataset->addSeries(series,axisY);
46 m_dataset->addSeries(series, axisY);
24 }
47 }
25
48
26 void QChart::removeSeries(QChartSeries* series)
49 void QChart::removeSeries(QChartSeries* series)
@@ -1,5 +1,5
1 #ifndef CHART_H
1 #ifndef QCHART_H
2 #define CHART_H
2 #define QCHART_H
3
3
4 #include <qchartglobal.h>
4 #include <qchartglobal.h>
5 #include <qchartseries.h>
5 #include <qchartseries.h>
@@ -21,9 +21,6 class ChartItem;
21 class ChartDataSet;
21 class ChartDataSet;
22 class ChartPresenter;
22 class ChartPresenter;
23
23
24 /*!
25 * TODO: define the responsibilities
26 */
27 class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget
24 class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget
28 {
25 {
29 Q_OBJECT
26 Q_OBJECT
@@ -34,7 +31,7 public:
34 ChartThemeVanilla,
31 ChartThemeVanilla,
35 ChartThemeIcy,
32 ChartThemeIcy,
36 ChartThemeGrayscale,
33 ChartThemeGrayscale,
37 ChartThemeScientific,
34 ChartThemeScientific
38 //ChartThemeUnnamed1
35 //ChartThemeUnnamed1
39 };
36 };
40
37
@@ -42,7 +39,7 public:
42 QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
39 QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
43 ~QChart();
40 ~QChart();
44
41
45 void addSeries(QChartSeries* series,QChartAxis* axisY=0);// takes series ownership , takes axis ownership
42 void addSeries(QChartSeries* series, QChartAxis* axisY = 0);
46 void removeSeries(QChartSeries* series); //returns ownership , deletes axis if no series attached
43 void removeSeries(QChartSeries* series); //returns ownership , deletes axis if no series attached
47 void removeAllSeries(); // deletes series and axis
44 void removeAllSeries(); // deletes series and axis
48
45
General Comments 0
You need to be logged in to leave comments. Login now