@@ -13,8 +13,8 integrated_build:{ | |||
|
13 | 13 | |
|
14 | 14 | CONFIG += ordered |
|
15 | 15 | QMAKE_CXXFLAGS += -g -Wall |
|
16 | unix:QMAKE_DISTCLEAN += -r build bin doc/html | |
|
17 | win32:QMAKE_DISTCLEAN += /Q /s build bin doc\\html | |
|
16 | unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html | |
|
17 | win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html | |
|
18 | 18 | |
|
19 | 19 | # install feature file |
|
20 | 20 | feature.path = $$[QT_INSTALL_DATA]/mkspecs/features |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include <QApplication> |
|
2 | 2 | #include <QMainWindow> |
|
3 | 3 | #include <qchartview.h> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <qchart.h> |
|
6 | 6 | #include <qchartaxis.h> |
|
7 | 7 | #include <cmath> |
@@ -16,11 +16,11 int main(int argc, char *argv[]) | |||
|
16 | 16 | |
|
17 | 17 | QMainWindow window; |
|
18 | 18 | |
|
19 |
QLine |
|
|
19 | QLineSeries* series0 = new QLineSeries(); | |
|
20 | 20 | QPen blue(Qt::blue); |
|
21 | 21 | blue.setWidth(3); |
|
22 | 22 | series0->setPen(blue); |
|
23 |
QLine |
|
|
23 | QLineSeries* series1 = new QLineSeries(); | |
|
24 | 24 | QPen red(Qt::red); |
|
25 | 25 | red.setWidth(3); |
|
26 | 26 | series1->setPen(red); |
@@ -2,7 +2,7 | |||
|
2 | 2 | #include <QMainWindow> |
|
3 | 3 | #include <qchartglobal.h> |
|
4 | 4 | #include <qchartview.h> |
|
5 |
#include <qline |
|
|
5 | #include <qlineseries.h> | |
|
6 | 6 | #include <qscatterseries.h> |
|
7 | 7 | #include <qbarseries.h> |
|
8 | 8 | #include <qbarset.h> |
@@ -21,7 +21,7 int main(int argc, char *argv[]) | |||
|
21 | 21 | chartView->setRenderHint(QPainter::Antialiasing); |
|
22 | 22 | chartView->setChartTitle("Simple Line Chart"); |
|
23 | 23 | // Add series to the chart |
|
24 |
QLine |
|
|
24 | QLineSeries *line = new QLineSeries(); | |
|
25 | 25 | line->add(0.0, 0.8); |
|
26 | 26 | line->add(1.1, 1.1); |
|
27 | 27 | line->add(2.0, 2.5); |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include <QApplication> |
|
2 | 2 | #include <QMainWindow> |
|
3 | 3 | #include <qchartview.h> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <qchart.h> |
|
6 | 6 | #include <cmath> |
|
7 | 7 | |
@@ -15,11 +15,11 int main(int argc, char *argv[]) | |||
|
15 | 15 | |
|
16 | 16 | QMainWindow window; |
|
17 | 17 | |
|
18 |
QLine |
|
|
18 | QLineSeries* series0 = new QLineSeries(); | |
|
19 | 19 | QPen blue(Qt::blue); |
|
20 | 20 | blue.setWidth(3); |
|
21 | 21 | series0->setPen(blue); |
|
22 |
QLine |
|
|
22 | QLineSeries* series1 = new QLineSeries(); | |
|
23 | 23 | QPen red(Qt::red); |
|
24 | 24 | red.setWidth(3); |
|
25 | 25 | series1->setPen(red); |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include <QApplication> |
|
2 | 2 | #include <QMainWindow> |
|
3 | 3 | #include <qchartview.h> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <qchart.h> |
|
6 | 6 | #include <cmath> |
|
7 | 7 | #include "wavegenerator.h" |
@@ -13,11 +13,11 int main(int argc, char *argv[]) | |||
|
13 | 13 | |
|
14 | 14 | QMainWindow window; |
|
15 | 15 | |
|
16 |
QLine |
|
|
16 | QLineSeries* series0 = new QLineSeries(); | |
|
17 | 17 | QPen blue(Qt::blue); |
|
18 | 18 | blue.setWidth(3); |
|
19 | 19 | series0->setPen(blue); |
|
20 |
QLine |
|
|
20 | QLineSeries* series1 = new QLineSeries(); | |
|
21 | 21 | QPen red(Qt::red); |
|
22 | 22 | red.setWidth(3); |
|
23 | 23 | series1->setPen(red); |
@@ -2,7 +2,7 | |||
|
2 | 2 | #include <QTime> |
|
3 | 3 | #include <QObject> |
|
4 | 4 | #include <cmath> |
|
5 |
#include <qline |
|
|
5 | #include <qlineseries.h> | |
|
6 | 6 | |
|
7 | 7 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
8 | 8 | |
@@ -14,7 +14,7 class WaveGenerator: public QObject | |||
|
14 | 14 | Q_OBJECT |
|
15 | 15 | |
|
16 | 16 | public: |
|
17 |
WaveGenerator(QLine |
|
|
17 | WaveGenerator(QLineSeries* series1, QLineSeries* series2) : | |
|
18 | 18 | m_series1(series1), |
|
19 | 19 | m_series2(series2), |
|
20 | 20 | m_wave(0), |
@@ -52,8 +52,8 public slots: | |||
|
52 | 52 | } |
|
53 | 53 | |
|
54 | 54 | private: |
|
55 |
QLine |
|
|
56 |
QLine |
|
|
55 | QLineSeries* m_series1; | |
|
56 | QLineSeries* m_series2; | |
|
57 | 57 | int m_wave; |
|
58 | 58 | qreal m_step; |
|
59 | 59 | QTimer m_timer; |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include <QApplication> |
|
2 | 2 | #include <QMainWindow> |
|
3 | 3 | #include <qchartview.h> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <qchart.h> |
|
6 | 6 | #include <cmath> |
|
7 | 7 | |
@@ -15,12 +15,12 int main(int argc, char *argv[]) | |||
|
15 | 15 | |
|
16 | 16 | //![1] |
|
17 | 17 | |
|
18 |
QLine |
|
|
18 | QLineSeries* series0 = new QLineSeries(); | |
|
19 | 19 | QPen blue(Qt::blue); |
|
20 | 20 | blue.setWidth(3); |
|
21 | 21 | series0->setPen(blue); |
|
22 | 22 | |
|
23 |
QLine |
|
|
23 | QLineSeries* series1 = new QLineSeries(); | |
|
24 | 24 | QPen red(Qt::red); |
|
25 | 25 | red.setWidth(3); |
|
26 | 26 | series1->setPen(red); |
@@ -1,5 +1,5 | |||
|
1 | 1 | #include "chartview.h" |
|
2 |
#include <qline |
|
|
2 | #include <qlineseries.h> | |
|
3 | 3 | #include <QTime> |
|
4 | 4 | |
|
5 | 5 | ChartView::ChartView(QWidget* parent):QChartView(parent), |
@@ -11,15 +11,15 m_index(0) | |||
|
11 | 11 | QTime now = QTime::currentTime(); |
|
12 | 12 | qsrand((uint)now.msec()); |
|
13 | 13 | |
|
14 |
QLine |
|
|
14 | QLineSeries* series0 = new QLineSeries(); | |
|
15 | 15 | QPen blue(Qt::blue); |
|
16 | 16 | blue.setWidth(3); |
|
17 | 17 | series0->setPen(blue); |
|
18 |
QLine |
|
|
18 | QLineSeries* series1 = new QLineSeries(); | |
|
19 | 19 | QPen red(Qt::red); |
|
20 | 20 | red.setWidth(3); |
|
21 | 21 | series1->setPen(red); |
|
22 |
QLine |
|
|
22 | QLineSeries* series2 = new QLineSeries(); | |
|
23 | 23 | QPen green(Qt::green); |
|
24 | 24 | green.setWidth(3); |
|
25 | 25 | series2->setPen(green); |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include "chartwidget.h" |
|
2 | 2 | #include <QApplication> |
|
3 | 3 | #include <QMainWindow> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <cmath> |
|
6 | 6 | |
|
7 | 7 | QTCOMMERCIALCHART_USE_NAMESPACE |
@@ -14,11 +14,11 int main(int argc, char *argv[]) | |||
|
14 | 14 | |
|
15 | 15 | QMainWindow window; |
|
16 | 16 | |
|
17 |
QLine |
|
|
17 | QLineSeries* series0 = new QLineSeries(); | |
|
18 | 18 | QPen blue(Qt::blue); |
|
19 | 19 | blue.setWidth(3); |
|
20 | 20 | series0->setPen(blue); |
|
21 |
QLine |
|
|
21 | QLineSeries* series1 = new QLineSeries(); | |
|
22 | 22 | QPen red(Qt::red); |
|
23 | 23 | red.setWidth(3); |
|
24 | 24 | series1->setPen(red); |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include "declarativelineseries.h" |
|
2 | 2 | #include "declarativechart.h" |
|
3 | 3 | #include "qchart.h" |
|
4 |
#include "qline |
|
|
4 | #include "qlineseries.h" | |
|
5 | 5 | |
|
6 | 6 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
7 | 7 | |
@@ -23,7 +23,7 void DeclarativeLineSeries::setParentForSeries() | |||
|
23 | 23 | qDebug() << "creating line series for chart: " << chart; |
|
24 | 24 | Q_ASSERT(chart); |
|
25 | 25 | |
|
26 |
m_series = new QLine |
|
|
26 | m_series = new QLineSeries(); | |
|
27 | 27 | Q_ASSERT(m_series); |
|
28 | 28 | for (int i(0); i < m_data.count(); i++) { |
|
29 | 29 | ScatterElement *element = m_data.at(i); |
@@ -8,7 +8,7 | |||
|
8 | 8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
9 | 9 | |
|
10 | 10 | class QChart; |
|
11 |
class QLine |
|
|
11 | class QLineSeries; | |
|
12 | 12 | |
|
13 | 13 | class DeclarativeLineSeries : public QDeclarativeItem |
|
14 | 14 | { |
@@ -30,7 +30,7 private slots: | |||
|
30 | 30 | |
|
31 | 31 | private: |
|
32 | 32 | QChart *m_chart; |
|
33 |
QLine |
|
|
33 | QLineSeries *m_series; | |
|
34 | 34 | QList<ScatterElement *> m_data; |
|
35 | 35 | }; |
|
36 | 36 |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include "chartdataset_p.h" |
|
2 | 2 | #include "qchartaxis.h" |
|
3 | 3 | //series |
|
4 |
#include "qline |
|
|
4 | #include "qlineseries.h" | |
|
5 | 5 | #include "qbarseries.h" |
|
6 | 6 | #include "qstackedbarseries.h" |
|
7 | 7 | #include "qpercentbarseries.h" |
@@ -57,7 +57,7 void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) | |||
|
57 | 57 | { |
|
58 | 58 | case QChartSeries::SeriesTypeLine: { |
|
59 | 59 | |
|
60 |
QLine |
|
|
60 | QLineSeries* xyseries = static_cast<QLineSeries*>(series); | |
|
61 | 61 | |
|
62 | 62 | for (int i = 0; i < xyseries->count(); i++) |
|
63 | 63 | { |
@@ -7,7 +7,7 | |||
|
7 | 7 | #include "qbarseries.h" |
|
8 | 8 | #include "qstackedbarseries.h" |
|
9 | 9 | #include "qpercentbarseries.h" |
|
10 |
#include "qline |
|
|
10 | #include "qlineseries.h" | |
|
11 | 11 | #include "qpieseries.h" |
|
12 | 12 | #include "qscatterseries.h" |
|
13 | 13 | //items |
@@ -109,7 +109,7 void ChartPresenter::handleSeriesAdded(QChartSeries* series) | |||
|
109 | 109 | switch(series->type()) |
|
110 | 110 | { |
|
111 | 111 | case QChartSeries::SeriesTypeLine: { |
|
112 |
QLine |
|
|
112 | QLineSeries* lineSeries = static_cast<QLineSeries*>(series); | |
|
113 | 113 | LineChartItem* item; |
|
114 | 114 | if(m_options.testFlag(QChart::SeriesAnimations)){ |
|
115 | 115 | item = new LineChartAnimationItem(this,lineSeries,m_chart); |
@@ -8,7 +8,7 | |||
|
8 | 8 | #include "qbarseries.h" |
|
9 | 9 | #include "qstackedbarseries.h" |
|
10 | 10 | #include "qpercentbarseries.h" |
|
11 |
#include "qline |
|
|
11 | #include "qlineseries.h" | |
|
12 | 12 | #include "qscatterseries.h" |
|
13 | 13 | #include "qpieseries.h" |
|
14 | 14 | #include "qpieslice.h" |
@@ -85,7 +85,7 void ChartTheme::decorate(ChartItem* item, QChartSeries* series,int count) | |||
|
85 | 85 | switch(series->type()) |
|
86 | 86 | { |
|
87 | 87 | case QChartSeries::SeriesTypeLine: { |
|
88 |
QLine |
|
|
88 | QLineSeries* s = static_cast<QLineSeries*>(series); | |
|
89 | 89 | LineChartItem* i = static_cast<LineChartItem*>(item); |
|
90 | 90 | decorate(i,s,count); |
|
91 | 91 | break; |
@@ -129,7 +129,7 void ChartTheme::decorate(ChartItem* item, QChartSeries* series,int count) | |||
|
129 | 129 | |
|
130 | 130 | } |
|
131 | 131 | |
|
132 |
void ChartTheme::decorate(LineChartItem* item, QLine |
|
|
132 | void ChartTheme::decorate(LineChartItem* item, QLineSeries* series,int count) | |
|
133 | 133 | { |
|
134 | 134 | QPen pen; |
|
135 | 135 | if(pen != series->pen()){ |
@@ -10,7 +10,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
10 | 10 | class ChartItem; |
|
11 | 11 | class QChartSeries; |
|
12 | 12 | class LineChartItem; |
|
13 |
class QLine |
|
|
13 | class QLineSeries; | |
|
14 | 14 | class BarPresenter; |
|
15 | 15 | class QBarSeries; |
|
16 | 16 | class StackedBarPresenter; |
@@ -31,10 +31,10 public: | |||
|
31 | 31 | QChart::ChartTheme id() const {return m_id;} |
|
32 | 32 | void decorate(QChart* chart); |
|
33 | 33 | void decorate(ChartItem* item, QChartSeries* series,int count); |
|
34 | void decorate(LineChartItem* item, QLineChartSeries*, int count); | |
|
35 | 34 | void decorate(BarPresenter* item, QBarSeries* series,int count); |
|
36 | 35 | void decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count); |
|
37 | 36 | void decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count); |
|
37 | void decorate(LineChartItem* item, QLineSeries*, int count); | |
|
38 | 38 | void decorate(ScatterPresenter* presenter, QScatterSeries* series, int count); |
|
39 | 39 | void decorate(PiePresenter* item, QPieSeries* series, int count); |
|
40 | 40 | void decorate(QChartAxis* axis,AxisItem* item); |
@@ -4,11 +4,11 DEPENDPATH += $$PWD | |||
|
4 | 4 | SOURCES += \ |
|
5 | 5 | $$PWD/linechartanimationitem.cpp \ |
|
6 | 6 | $$PWD/linechartitem.cpp \ |
|
7 |
$$PWD/qline |
|
|
7 | $$PWD/qlineseries.cpp | |
|
8 | 8 | |
|
9 | 9 | PRIVATE_HEADERS += \ |
|
10 | 10 | $$PWD/linechartitem_p.h \ |
|
11 | 11 | $$PWD/linechartanimationitem_p.h |
|
12 | 12 | |
|
13 | 13 | PUBLIC_HEADERS += \ |
|
14 |
$$PWD/qline |
|
|
14 | $$PWD/qlineseries.h No newline at end of file |
@@ -7,7 +7,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
7 | 7 | const static int duration = 500; |
|
8 | 8 | |
|
9 | 9 | |
|
10 |
LineChartAnimationItem::LineChartAnimationItem(ChartPresenter* presenter, QLine |
|
|
10 | LineChartAnimationItem::LineChartAnimationItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent): | |
|
11 | 11 | LineChartItem(presenter,series,parent) |
|
12 | 12 | { |
|
13 | 13 |
@@ -14,7 +14,7 class LineChartAnimationItem : public LineChartItem { | |||
|
14 | 14 | Q_PROPERTY(int a_addPoints READ ar_addPoints WRITE aw_addPoints); |
|
15 | 15 | // Q_PROPERTY(QPointF a_setPoint READ ar_setPoint WRITE aw_setPoint); |
|
16 | 16 | public: |
|
17 |
LineChartAnimationItem(ChartPresenter* presenter, QLine |
|
|
17 | LineChartAnimationItem(ChartPresenter* presenter, QLineSeries *series, QGraphicsItem *parent = 0); | |
|
18 | 18 | virtual ~LineChartAnimationItem(); |
|
19 | 19 | |
|
20 | 20 | void addPoints(const QVector<QPointF>& points); |
@@ -1,5 +1,5 | |||
|
1 | 1 | #include "linechartitem_p.h" |
|
2 |
#include "qline |
|
|
2 | #include "qlineseries.h" | |
|
3 | 3 | #include "chartpresenter_p.h" |
|
4 | 4 | #include <QPainter> |
|
5 | 5 | |
@@ -8,7 +8,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
8 | 8 | |
|
9 | 9 | //TODO: optimazie : remove points which are not visible |
|
10 | 10 | |
|
11 |
LineChartItem::LineChartItem(ChartPresenter* presenter, QLine |
|
|
11 | LineChartItem::LineChartItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent):ChartItem(parent), | |
|
12 | 12 | m_presenter(presenter), |
|
13 | 13 | m_series(series), |
|
14 | 14 | m_dirtyData(false), |
@@ -111,7 +111,7 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt | |||
|
111 | 111 | painter->restore(); |
|
112 | 112 | } |
|
113 | 113 | |
|
114 |
void LineChartItem::calculatePoint(QPointF& point, int index, const QLine |
|
|
114 | void LineChartItem::calculatePoint(QPointF& point, int index, const QLineSeries* series,const QSizeF& size, const Domain& domain) const | |
|
115 | 115 | { |
|
116 | 116 | const qreal deltaX = size.width()/domain.spanX(); |
|
117 | 117 | const qreal deltaY = size.height()/domain.spanY(); |
@@ -122,7 +122,7 void LineChartItem::calculatePoint(QPointF& point, int index, const QLineChartSe | |||
|
122 | 122 | } |
|
123 | 123 | |
|
124 | 124 | |
|
125 |
void LineChartItem::calculatePoints(QVector<QPointF>& points, QHash<int,int>& hash,const QLine |
|
|
125 | void LineChartItem::calculatePoints(QVector<QPointF>& points, QHash<int,int>& hash,const QLineSeries* series,const QSizeF& size, const Domain& domain) const | |
|
126 | 126 | { |
|
127 | 127 | const qreal deltaX = size.width()/domain.spanX(); |
|
128 | 128 | const qreal deltaY = size.height()/domain.spanY(); |
@@ -8,14 +8,14 | |||
|
8 | 8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
9 | 9 | |
|
10 | 10 | class ChartPresenter; |
|
11 |
class QLine |
|
|
11 | class QLineSeries; | |
|
12 | 12 | class LineChartAnimationItem; |
|
13 | 13 | |
|
14 | 14 | class LineChartItem : public QObject , public ChartItem |
|
15 | 15 | { |
|
16 | 16 | Q_OBJECT |
|
17 | 17 | public: |
|
18 |
LineChartItem(ChartPresenter* presenter, QLine |
|
|
18 | LineChartItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent = 0); | |
|
19 | 19 | ~ LineChartItem(){}; |
|
20 | 20 | |
|
21 | 21 | //from QGraphicsItem |
@@ -43,8 +43,8 protected: | |||
|
43 | 43 | virtual void updateData(); |
|
44 | 44 | virtual void updateDomain(); |
|
45 | 45 | //refactor |
|
46 |
void calculatePoint(QPointF& point, int index, const QLine |
|
|
47 |
void calculatePoints(QVector<QPointF>& points,QHash<int,int>& hash,const QLine |
|
|
46 | void calculatePoint(QPointF& point, int index, const QLineSeries* series,const QSizeF& size, const Domain& domain) const; | |
|
47 | void calculatePoints(QVector<QPointF>& points,QHash<int,int>& hash,const QLineSeries* series, const QSizeF& size, const Domain& domain) const; | |
|
48 | 48 | |
|
49 | 49 | protected slots: |
|
50 | 50 | void handleModelChanged(int index); |
@@ -61,7 +61,7 private: | |||
|
61 | 61 | QList<QGraphicsItem*> m_points; |
|
62 | 62 | QVector<QPointF> m_data; |
|
63 | 63 | QHash<int,int> m_hash; |
|
64 |
QLine |
|
|
64 | QLineSeries* m_series; | |
|
65 | 65 | QPen m_pen; |
|
66 | 66 | bool m_dirtyData; |
|
67 | 67 | bool m_dirtyGeometry; |
@@ -1,4 +1,4 | |||
|
1 |
#include "qline |
|
|
1 | #include "qlineseries.h" | |
|
2 | 2 | |
|
3 | 3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
4 | 4 | |
@@ -55,7 +55,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
55 | 55 | Constructs empty series object which is a child of \a parent. |
|
56 | 56 | When series object is added to QChartView or QChart instance ownerships is transfered. |
|
57 | 57 | */ |
|
58 |
QLine |
|
|
58 | QLineSeries::QLineSeries(QObject* parent):QChartSeries(parent), | |
|
59 | 59 | m_pointsVisible(false) |
|
60 | 60 | { |
|
61 | 61 | } |
@@ -63,14 +63,14 m_pointsVisible(false) | |||
|
63 | 63 | Destroys the object. Series added to QChartView or QChart instances are owned by those, |
|
64 | 64 | and are deleted when mentioned object are destroyed. |
|
65 | 65 | */ |
|
66 |
QLine |
|
|
66 | QLineSeries::~QLineSeries() | |
|
67 | 67 | { |
|
68 | 68 | } |
|
69 | 69 | |
|
70 | 70 | /*! |
|
71 | 71 | Adds data point \a x \a y to the series. Points are connected with lines on the chart. |
|
72 | 72 | */ |
|
73 |
void QLine |
|
|
73 | void QLineSeries::add(qreal x,qreal y) | |
|
74 | 74 | { |
|
75 | 75 | m_x<<x; |
|
76 | 76 | m_y<<y; |
@@ -80,7 +80,7 void QLineChartSeries::add(qreal x,qreal y) | |||
|
80 | 80 | This is an overloaded function. |
|
81 | 81 | Adds data \a point to the series. Points are connected with lines on the chart. |
|
82 | 82 | */ |
|
83 |
void QLine |
|
|
83 | void QLineSeries::add(const QPointF& point) | |
|
84 | 84 | { |
|
85 | 85 | m_x<<point.x(); |
|
86 | 86 | m_y<<point.y(); |
@@ -89,7 +89,7 void QLineChartSeries::add(const QPointF& point) | |||
|
89 | 89 | /*! |
|
90 | 90 | Modifies \a y value for given \a x a value. |
|
91 | 91 | */ |
|
92 |
void QLine |
|
|
92 | void QLineSeries::replace(qreal x,qreal y) | |
|
93 | 93 | { |
|
94 | 94 | int index = m_x.indexOf(x); |
|
95 | 95 | m_x[index]=x; |
@@ -101,7 +101,7 void QLineChartSeries::replace(qreal x,qreal y) | |||
|
101 | 101 | This is an overloaded function. |
|
102 | 102 | Replaces current y value of for given \a point x value with \a point y value. |
|
103 | 103 | */ |
|
104 |
void QLine |
|
|
104 | void QLineSeries::replace(const QPointF& point) | |
|
105 | 105 | { |
|
106 | 106 | int index = m_x.indexOf(point.x()); |
|
107 | 107 | m_x[index]=point.x(); |
@@ -112,7 +112,7 void QLineChartSeries::replace(const QPointF& point) | |||
|
112 | 112 | /*! |
|
113 | 113 | Removes current \a x and y value. |
|
114 | 114 | */ |
|
115 |
void QLine |
|
|
115 | void QLineSeries::remove(qreal x) | |
|
116 | 116 | { |
|
117 | 117 | |
|
118 | 118 | } |
@@ -120,7 +120,7 void QLineChartSeries::remove(qreal x) | |||
|
120 | 120 | /*! |
|
121 | 121 | Removes current \a point x value. Note \point y value is ignored. |
|
122 | 122 | */ |
|
123 |
void QLine |
|
|
123 | void QLineSeries::remove(const QPointF& point) | |
|
124 | 124 | { |
|
125 | 125 | |
|
126 | 126 | } |
@@ -128,7 +128,7 void QLineChartSeries::remove(const QPointF& point) | |||
|
128 | 128 | /*! |
|
129 | 129 | Clears all the data. |
|
130 | 130 | */ |
|
131 |
void QLine |
|
|
131 | void QLineSeries::clear() | |
|
132 | 132 | { |
|
133 | 133 | m_x.clear(); |
|
134 | 134 | m_y.clear(); |
@@ -137,7 +137,7 void QLineChartSeries::clear() | |||
|
137 | 137 | /*! |
|
138 | 138 | \internal \a pos |
|
139 | 139 | */ |
|
140 |
qreal QLine |
|
|
140 | qreal QLineSeries::x(int pos) const | |
|
141 | 141 | { |
|
142 | 142 | return m_x.at(pos); |
|
143 | 143 | } |
@@ -145,7 +145,7 qreal QLineChartSeries::x(int pos) const | |||
|
145 | 145 | /*! |
|
146 | 146 | \internal \a pos |
|
147 | 147 | */ |
|
148 |
qreal QLine |
|
|
148 | qreal QLineSeries::y(int pos) const | |
|
149 | 149 | { |
|
150 | 150 | return m_y.at(pos); |
|
151 | 151 | } |
@@ -153,7 +153,7 qreal QLineChartSeries::y(int pos) const | |||
|
153 | 153 | /*! |
|
154 | 154 | Returns number of data points within series. |
|
155 | 155 | */ |
|
156 |
int QLine |
|
|
156 | int QLineSeries::count() const | |
|
157 | 157 | { |
|
158 | 158 | Q_ASSERT(m_x.size() == m_y.size()); |
|
159 | 159 | |
@@ -164,7 +164,7 int QLineChartSeries::count() const | |||
|
164 | 164 | /*! |
|
165 | 165 | Sets \a pen used for drawing given series.. |
|
166 | 166 | */ |
|
167 |
void QLine |
|
|
167 | void QLineSeries::setPen(const QPen& pen) | |
|
168 | 168 | { |
|
169 | 169 | m_pen=pen; |
|
170 | 170 | } |
@@ -172,12 +172,12 void QLineChartSeries::setPen(const QPen& pen) | |||
|
172 | 172 | /*! |
|
173 | 173 | Sets if data points are \a visible and should be drawn on line. |
|
174 | 174 | */ |
|
175 |
void QLine |
|
|
175 | void QLineSeries::setPointsVisible(bool visible) | |
|
176 | 176 | { |
|
177 | 177 | m_pointsVisible=visible; |
|
178 | 178 | } |
|
179 | 179 | |
|
180 |
QDebug operator<< (QDebug debug, const QLine |
|
|
180 | QDebug operator<< (QDebug debug, const QLineSeries series) | |
|
181 | 181 | { |
|
182 | 182 | Q_ASSERT(series.m_x.size() == series.m_y.size()); |
|
183 | 183 | |
@@ -190,6 +190,6 QDebug operator<< (QDebug debug, const QLineChartSeries series) | |||
|
190 | 190 | } |
|
191 | 191 | |
|
192 | 192 | |
|
193 |
#include "moc_qline |
|
|
193 | #include "moc_qlineseries.cpp" | |
|
194 | 194 | |
|
195 | 195 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -9,12 +9,12 | |||
|
9 | 9 | |
|
10 | 10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
11 | 11 | |
|
12 |
class QTCOMMERCIALCHART_EXPORT QLine |
|
|
12 | class QTCOMMERCIALCHART_EXPORT QLineSeries : public QChartSeries | |
|
13 | 13 | { |
|
14 | 14 | Q_OBJECT |
|
15 | 15 | public: |
|
16 |
QLine |
|
|
17 |
virtual ~QLine |
|
|
16 | QLineSeries(QObject* parent=0); | |
|
17 | virtual ~QLineSeries(); | |
|
18 | 18 | |
|
19 | 19 | public: // from QChartSeries |
|
20 | 20 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeLine;} |
@@ -35,7 +35,7 public: // from QChartSeries | |||
|
35 | 35 | int count() const; |
|
36 | 36 | qreal x(int pos) const; |
|
37 | 37 | qreal y(int pos) const; |
|
38 |
friend QDebug operator<< (QDebug d, const QLine |
|
|
38 | friend QDebug operator<< (QDebug d, const QLineSeries series); | |
|
39 | 39 | |
|
40 | 40 | signals: |
|
41 | 41 | void changed(int index); |
@@ -1,7 +1,7 | |||
|
1 | 1 | #include <QtTest/QtTest> |
|
2 | 2 | #include <qchartaxis.h> |
|
3 | 3 | #include <qchartseries.h> |
|
4 |
#include <qline |
|
|
4 | #include <qlineseries.h> | |
|
5 | 5 | #include <private/chartdataset_p.h> |
|
6 | 6 | #include <private/domain_p.h> |
|
7 | 7 | |
@@ -10,7 +10,7 QTCOMMERCIALCHART_USE_NAMESPACE | |||
|
10 | 10 | Q_DECLARE_METATYPE(Domain) |
|
11 | 11 | Q_DECLARE_METATYPE(QChartAxis*) |
|
12 | 12 | Q_DECLARE_METATYPE(QChartSeries*) |
|
13 |
Q_DECLARE_METATYPE(QLine |
|
|
13 | Q_DECLARE_METATYPE(QLineSeries*) | |
|
14 | 14 | |
|
15 | 15 | class tst_ChartDataSet: public QObject { |
|
16 | 16 | Q_OBJECT |
@@ -99,7 +99,7 void tst_ChartDataSet::addDomain() | |||
|
99 | 99 | ChartDataSet dataSet; |
|
100 | 100 | |
|
101 | 101 | Domain domain1(0, 1000, 0, 1000); |
|
102 |
QLine |
|
|
102 | QLineSeries series; | |
|
103 | 103 | series.add(0, 0); |
|
104 | 104 | series.add(1000, 1000); |
|
105 | 105 | |
@@ -173,7 +173,7 void tst_ChartDataSet::addSeries() | |||
|
173 | 173 | |
|
174 | 174 | for (int i = 0; i < seriesCount; i++) { |
|
175 | 175 | QChartAxis* axisY = 0; |
|
176 |
QLine |
|
|
176 | QLineSeries* series = new QLineSeries(); | |
|
177 | 177 | if (iterator != axisList.end()) { |
|
178 | 178 | axisY = *iterator; |
|
179 | 179 | iterator++; |
@@ -218,10 +218,10 void tst_ChartDataSet::axisY() | |||
|
218 | 218 | |
|
219 | 219 | QVERIFY2(defaultAxisY, "Missing axisY."); |
|
220 | 220 | |
|
221 |
QLine |
|
|
221 | QLineSeries* series1 = new QLineSeries(); | |
|
222 | 222 | dataSet.addSeries(series1); |
|
223 | 223 | |
|
224 |
QLine |
|
|
224 | QLineSeries* series2 = new QLineSeries(); | |
|
225 | 225 | dataSet.addSeries(series2, axisY); |
|
226 | 226 | |
|
227 | 227 | QVERIFY(dataSet.axisY(series1) == defaultAxisY); |
@@ -244,7 +244,7 void tst_ChartDataSet::clearDomains() | |||
|
244 | 244 | QFETCH(int, indexCount); |
|
245 | 245 | |
|
246 | 246 | Domain domain1(0, 100, 0, 100); |
|
247 |
QLine |
|
|
247 | QLineSeries* series = new QLineSeries(); | |
|
248 | 248 | series->add(0, 0); |
|
249 | 249 | series->add(100, 100); |
|
250 | 250 | |
@@ -315,13 +315,13 void tst_ChartDataSet::domain() | |||
|
315 | 315 | QFETCH(Domain, domain); |
|
316 | 316 | |
|
317 | 317 | ChartDataSet dataSet; |
|
318 |
QLine |
|
|
318 | QLineSeries* series1 = new QLineSeries(); | |
|
319 | 319 | series1->add(domain1.m_minX, domain1.m_minY); |
|
320 | 320 | series1->add(domain1.m_maxX, domain1.m_maxY); |
|
321 |
QLine |
|
|
321 | QLineSeries* series2 = new QLineSeries(); | |
|
322 | 322 | series2->add(domain2.m_minX, domain2.m_minY); |
|
323 | 323 | series2->add(domain2.m_maxX, domain2.m_maxY); |
|
324 |
QLine |
|
|
324 | QLineSeries* series3 = new QLineSeries(); | |
|
325 | 325 | series3->add(domain3.m_minX, domain3.m_minY); |
|
326 | 326 | series3->add(domain3.m_maxX, domain3.m_maxY); |
|
327 | 327 | |
@@ -370,7 +370,7 void tst_ChartDataSet::nextpreviousDomain() | |||
|
370 | 370 | ChartDataSet dataSet; |
|
371 | 371 | |
|
372 | 372 | Domain domain1(0, 1000, 0, 1000); |
|
373 |
QLine |
|
|
373 | QLineSeries* series = new QLineSeries(); | |
|
374 | 374 | series->add(0, 0); |
|
375 | 375 | series->add(1000, 1000); |
|
376 | 376 | |
@@ -487,7 +487,7 void tst_ChartDataSet::removeSeries() | |||
|
487 | 487 | |
|
488 | 488 | for (int i = 0; i < seriesCount; i++) { |
|
489 | 489 | QChartAxis* axisY = 0; |
|
490 |
QLine |
|
|
490 | QLineSeries* series = new QLineSeries(); | |
|
491 | 491 | if (iterator != axisList.end()) { |
|
492 | 492 | axisY = *iterator; |
|
493 | 493 | iterator++; |
@@ -559,7 +559,7 void tst_ChartDataSet::removeAllSeries() | |||
|
559 | 559 | |
|
560 | 560 | for (int i = 0; i < seriesCount; i++) { |
|
561 | 561 | QChartAxis* axisY = 0; |
|
562 |
QLine |
|
|
562 | QLineSeries* series = new QLineSeries(); | |
|
563 | 563 | if (iterator != axisList.end()) { |
|
564 | 564 | axisY = *iterator; |
|
565 | 565 | iterator++; |
@@ -3,7 +3,7 | |||
|
3 | 3 | #include "qchartseries.h" |
|
4 | 4 | #include "qpieseries.h" |
|
5 | 5 | #include "qscatterseries.h" |
|
6 |
#include <qline |
|
|
6 | #include <qlineseries.h> | |
|
7 | 7 | #include <qbarset.h> |
|
8 | 8 | #include <qbarcategory.h> |
|
9 | 9 | #include <qbarseries.h> |
@@ -219,7 +219,7 void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QS | |||
|
219 | 219 | if (seriesName.contains("line", Qt::CaseInsensitive)) { |
|
220 | 220 | for (int j(0); j < data.count(); j ++) { |
|
221 | 221 | QList<qreal> column = data.at(j); |
|
222 |
QLine |
|
|
222 | QLineSeries *series = new QLineSeries(); | |
|
223 | 223 | for (int i(0); i < column.count(); i++) { |
|
224 | 224 | series->add(i, column.at(i)); |
|
225 | 225 | } |
General Comments 0
You need to be logged in to leave comments.
Login now