@@ -1,53 +1,52 | |||||
1 | #ifndef BARCHARTSERIES_H |
|
1 | #ifndef BARCHARTSERIES_H | |
2 | #define BARCHARTSERIES_H |
|
2 | #define BARCHARTSERIES_H | |
3 |
|
3 | |||
4 | #include <QList> |
|
4 | #include <QList> | |
5 | #include <QAbstractItemModel> |
|
5 | #include <QAbstractItemModel> | |
6 | #include "qchartseries.h" |
|
6 | #include "qchartseries.h" | |
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 | class QBarCategory; |
|
10 | class QBarCategory; | |
11 | class QBarSet; |
|
11 | class QBarSet; | |
12 | class BarChartModel; |
|
12 | class BarChartModel; | |
13 |
|
13 | |||
14 | // Container for series |
|
14 | // Container for series | |
15 | class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries |
|
15 | class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries | |
16 | { |
|
16 | { | |
17 | Q_OBJECT |
|
17 | Q_OBJECT | |
18 | public: |
|
18 | public: | |
19 | QBarChartSeries(QBarCategory *category, QObject* parent=0); |
|
19 | QBarChartSeries(QBarCategory *category, QObject* parent=0); | |
20 |
|
20 | |||
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; } |
|
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; } | |
22 |
|
22 | |||
23 | void addBarSet(QBarSet *set); // Takes ownership of set |
|
23 | void addBarSet(QBarSet *set); // Takes ownership of set | |
24 | void removeBarSet(QBarSet *set); // Removes set, releases ownership. |
|
24 | void removeBarSet(QBarSet *set); // Removes set, releases ownership. | |
25 | int countSets(); |
|
25 | int countSets(); | |
26 | QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true |
|
26 | QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true | |
27 |
|
27 | |||
28 | //TODO: |
|
28 | //TODO: | |
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) |
|
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) | |
30 |
|
30 | |||
31 | // TODO: Functions below this are not part of api and will be moved |
|
31 | // TODO: Functions below this are not part of api and will be moved | |
32 | // to private implementation, when we start using it (not part of api) |
|
32 | // to private implementation, when we start using it (not part of api) | |
33 | int countCategories(); |
|
33 | int countCategories(); | |
34 | qreal min(); |
|
34 | qreal min(); | |
35 | qreal max(); |
|
35 | qreal max(); | |
36 | qreal valueAt(int set, int category); |
|
36 | qreal valueAt(int set, int category); | |
37 | qreal maxCategorySum(); |
|
37 | qreal maxCategorySum(); | |
38 |
|
38 | |||
39 | BarChartModel& model(); |
|
39 | BarChartModel& model(); | |
40 |
|
40 | |||
41 | signals: |
|
41 | signals: | |
42 | void changed(int index); |
|
42 | void changed(int index); | |
43 |
|
43 | |||
44 | public Q_SLOTS: |
|
44 | public Q_SLOTS: | |
45 |
|
45 | |||
46 | private: |
|
46 | private: | |
47 |
|
||||
48 | BarChartModel* mModel; |
|
47 | BarChartModel* mModel; | |
49 | }; |
|
48 | }; | |
50 |
|
49 | |||
51 | QTCOMMERCIALCHART_END_NAMESPACE |
|
50 | QTCOMMERCIALCHART_END_NAMESPACE | |
52 |
|
51 | |||
53 | #endif // BARCHARTSERIES_H |
|
52 | #endif // BARCHARTSERIES_H |
@@ -1,56 +1,55 | |||||
1 | #ifndef PERCENTBARCHARTSERIES_H |
|
1 | #ifndef PERCENTBARCHARTSERIES_H | |
2 | #define PERCENTBARCHARTSERIES_H |
|
2 | #define PERCENTBARCHARTSERIES_H | |
3 |
|
3 | |||
4 | #include <QList> |
|
4 | #include <QList> | |
5 | #include <QAbstractItemModel> |
|
5 | #include <QAbstractItemModel> | |
6 | #include "qchartseries.h" |
|
6 | #include "qchartseries.h" | |
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 | class QBarCategory; |
|
10 | class QBarCategory; | |
11 | class QBarSet; |
|
11 | class QBarSet; | |
12 | class BarChartModel; |
|
12 | class BarChartModel; | |
13 |
|
13 | |||
14 | class QTCOMMERCIALCHART_EXPORT QPercentBarChartSeries : public QChartSeries |
|
14 | class QTCOMMERCIALCHART_EXPORT QPercentBarChartSeries : public QChartSeries | |
15 | { |
|
15 | { | |
16 | Q_OBJECT |
|
16 | Q_OBJECT | |
17 | public: |
|
17 | public: | |
18 | QPercentBarChartSeries(QBarCategory *category, QObject* parent=0); |
|
18 | QPercentBarChartSeries(QBarCategory *category, QObject* parent=0); | |
19 |
|
19 | |||
20 | // from BarChartSeriesBase |
|
20 | // from BarChartSeriesBase | |
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypePercentBar; } |
|
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypePercentBar; } | |
22 |
|
22 | |||
23 | void addBarSet(QBarSet *set); // Takes ownership |
|
23 | void addBarSet(QBarSet *set); // Takes ownership | |
24 | void removeBarSet(QBarSet *set); // Also deletes the set, if set is owned. |
|
24 | void removeBarSet(QBarSet *set); // Also deletes the set, if set is owned. | |
25 | int countSets(); |
|
25 | int countSets(); | |
26 | QBarSet* nextSet(bool first=false); // Returns first set, if called with true |
|
26 | QBarSet* nextSet(bool first=false); // Returns first set, if called with true | |
27 |
|
27 | |||
28 | //TODO: |
|
28 | //TODO: | |
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) |
|
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) | |
30 |
|
30 | |||
31 | // TODO: Functions below this are not part of api and will be moved |
|
31 | // TODO: Functions below this are not part of api and will be moved | |
32 | // to private implementation, when we start using it (not part of api) |
|
32 | // to private implementation, when we start using it (not part of api) | |
33 | int countCategories(); |
|
33 | int countCategories(); | |
34 | qreal min(); |
|
34 | qreal min(); | |
35 | qreal max(); |
|
35 | qreal max(); | |
36 | qreal valueAt(int set, int category); |
|
36 | qreal valueAt(int set, int category); | |
37 | qreal maxCategorySum(); |
|
37 | qreal maxCategorySum(); | |
38 |
|
38 | |||
39 | BarChartModel& model(); |
|
39 | BarChartModel& model(); | |
40 |
|
40 | |||
41 | signals: |
|
41 | signals: | |
42 | void changed(int index); |
|
42 | void changed(int index); | |
43 |
|
43 | |||
44 | public Q_SLOTS: |
|
44 | public Q_SLOTS: | |
45 |
|
45 | |||
46 |
|
46 | |||
47 | private: |
|
47 | private: | |
48 |
|
||||
49 | BarChartModel* mModel; |
|
48 | BarChartModel* mModel; | |
50 |
|
49 | |||
51 | }; |
|
50 | }; | |
52 |
|
51 | |||
53 | QTCOMMERCIALCHART_END_NAMESPACE |
|
52 | QTCOMMERCIALCHART_END_NAMESPACE | |
54 |
|
53 | |||
55 |
|
54 | |||
56 | #endif // PERCENTBARCHARTSERIES_H |
|
55 | #endif // PERCENTBARCHARTSERIES_H |
@@ -1,53 +1,52 | |||||
1 | #ifndef STACKEDBARCHARTSERIES_H |
|
1 | #ifndef STACKEDBARCHARTSERIES_H | |
2 | #define STACKEDBARCHARTSERIES_H |
|
2 | #define STACKEDBARCHARTSERIES_H | |
3 |
|
3 | |||
4 | #include <QList> |
|
4 | #include <QList> | |
5 | #include <QAbstractItemModel> |
|
5 | #include <QAbstractItemModel> | |
6 | #include "qchartseries.h" |
|
6 | #include "qchartseries.h" | |
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 | class QBarCategory; |
|
10 | class QBarCategory; | |
11 | class QBarSet; |
|
11 | class QBarSet; | |
12 | class BarChartModel; |
|
12 | class BarChartModel; | |
13 |
|
13 | |||
14 | class QTCOMMERCIALCHART_EXPORT QStackedBarChartSeries : public QChartSeries |
|
14 | class QTCOMMERCIALCHART_EXPORT QStackedBarChartSeries : public QChartSeries | |
15 | { |
|
15 | { | |
16 | Q_OBJECT |
|
16 | Q_OBJECT | |
17 | public: |
|
17 | public: | |
18 | QStackedBarChartSeries(QBarCategory *category, QObject* parent=0); |
|
18 | QStackedBarChartSeries(QBarCategory *category, QObject* parent=0); | |
19 |
|
19 | |||
20 | // from QChartSeries |
|
20 | // from QChartSeries | |
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeStackedBar; } |
|
21 | virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeStackedBar; } | |
22 |
|
22 | |||
23 | void addBarSet(QBarSet *set); // Takes ownership |
|
23 | void addBarSet(QBarSet *set); // Takes ownership | |
24 | void removeBarSet(QBarSet *set); // Also deletes the set, if set is owned. |
|
24 | void removeBarSet(QBarSet *set); // Also deletes the set, if set is owned. | |
25 | int countSets(); |
|
25 | int countSets(); | |
26 | QBarSet* nextSet(bool first=false); // Returns first set, if called with true |
|
26 | QBarSet* nextSet(bool first=false); // Returns first set, if called with true | |
27 |
|
27 | |||
28 | //TODO: |
|
28 | //TODO: | |
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) |
|
29 | //QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) | |
30 |
|
30 | |||
31 | // TODO: Functions below this are not part of api and will be moved |
|
31 | // TODO: Functions below this are not part of api and will be moved | |
32 | // to private implementation, when we start using it (not part of api) |
|
32 | // to private implementation, when we start using it (not part of api) | |
33 | int countCategories(); |
|
33 | int countCategories(); | |
34 | qreal min(); |
|
34 | qreal min(); | |
35 | qreal max(); |
|
35 | qreal max(); | |
36 | qreal valueAt(int set, int category); |
|
36 | qreal valueAt(int set, int category); | |
37 | qreal maxCategorySum(); |
|
37 | qreal maxCategorySum(); | |
38 |
|
38 | |||
39 | BarChartModel& model(); |
|
39 | BarChartModel& model(); | |
40 |
|
40 | |||
41 | signals: |
|
41 | signals: | |
42 | void changed(int index); |
|
42 | void changed(int index); | |
43 |
|
43 | |||
44 | public Q_SLOTS: |
|
44 | public Q_SLOTS: | |
45 |
|
45 | |||
46 | private: |
|
46 | private: | |
47 |
|
||||
48 | BarChartModel* mModel; |
|
47 | BarChartModel* mModel; | |
49 | }; |
|
48 | }; | |
50 |
|
49 | |||
51 | QTCOMMERCIALCHART_END_NAMESPACE |
|
50 | QTCOMMERCIALCHART_END_NAMESPACE | |
52 |
|
51 | |||
53 | #endif // STACKEDBARCHARTSERIES_H |
|
52 | #endif // STACKEDBARCHARTSERIES_H |
@@ -1,334 +1,337 | |||||
1 | #include "chartdataset_p.h" |
|
1 | #include "chartdataset_p.h" | |
2 | #include "qchartaxis.h" |
|
2 | #include "qchartaxis.h" | |
3 | //series |
|
3 | //series | |
4 | #include "qlinechartseries.h" |
|
4 | #include "qlinechartseries.h" | |
5 | #include "qbarchartseries.h" |
|
5 | #include "qbarchartseries.h" | |
6 | #include "qstackedbarchartseries.h" |
|
6 | #include "qstackedbarchartseries.h" | |
7 | #include "qpercentbarchartseries.h" |
|
7 | #include "qpercentbarchartseries.h" | |
8 | #include "qpieseries.h" |
|
8 | #include "qpieseries.h" | |
9 | #include "qscatterseries.h" |
|
9 | #include "qscatterseries.h" | |
10 |
|
10 | |||
11 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
11 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
12 |
|
12 | |||
13 | ChartDataSet::ChartDataSet(QObject *parent):QObject(parent), |
|
13 | ChartDataSet::ChartDataSet(QObject *parent):QObject(parent), | |
14 | m_axisX(new QChartAxis(this)), |
|
14 | m_axisX(new QChartAxis(this)), | |
15 | m_axisY(new QChartAxis(this)), |
|
15 | m_axisY(new QChartAxis(this)), | |
16 | m_domainIndex(0), |
|
16 | m_domainIndex(0), | |
17 | m_axisXInitialized(false) |
|
17 | m_axisXInitialized(false) | |
18 | { |
|
18 | { | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | ChartDataSet::~ChartDataSet() |
|
21 | ChartDataSet::~ChartDataSet() | |
22 | { |
|
22 | { | |
23 | // TODO Auto-generated destructor stub |
|
23 | // TODO Auto-generated destructor stub | |
24 | } |
|
24 | } | |
25 |
|
25 | |||
26 | const Domain ChartDataSet::domain(QChartAxis *axisY) const |
|
26 | const Domain ChartDataSet::domain(QChartAxis *axisY) const | |
27 | { |
|
27 | { | |
28 | int i = m_domainMap.count(axisY); |
|
28 | int i = m_domainMap.count(axisY); | |
29 | if(i == 0){ |
|
29 | if(i == 0){ | |
30 | return Domain(); |
|
30 | return Domain(); | |
31 | } |
|
31 | } | |
32 | i = i - m_domainIndex -1; |
|
32 | i = i - m_domainIndex -1; | |
33 | return m_domainMap.values(axisY).at(i); |
|
33 | return m_domainMap.values(axisY).at(i); | |
34 | } |
|
34 | } | |
35 |
|
35 | |||
36 | void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) |
|
36 | void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) | |
37 | { |
|
37 | { | |
38 | // TODO: we should check the series not already added |
|
38 | // TODO: we should check the series not already added | |
39 | series->setParent(this); // take ownership |
|
39 | series->setParent(this); // take ownership | |
40 |
|
40 | |||
41 | series->setParent(this); // take ownership |
|
41 | series->setParent(this); // take ownership | |
42 | clearDomains(); |
|
42 | clearDomains(); | |
43 |
|
43 | |||
44 | if(axisY==0) axisY = m_axisY; |
|
44 | if(axisY==0) axisY = m_axisY; | |
45 |
|
45 | |||
46 | QList<QChartSeries*> seriesList = m_seriesMap.values(axisY); |
|
46 | QList<QChartSeries*> seriesList = m_seriesMap.values(axisY); | |
47 |
|
47 | |||
48 | QList<Domain> domainList = m_domainMap.values(axisY); |
|
48 | QList<Domain> domainList = m_domainMap.values(axisY); | |
49 |
|
49 | |||
50 | Q_ASSERT(domainList.size()<=1); |
|
50 | Q_ASSERT(domainList.size()<=1); | |
51 |
|
51 | |||
52 | Domain domain; |
|
52 | Domain domain; | |
53 |
|
53 | |||
54 | if(domainList.size()>0) domain = domainList.at(0); |
|
54 | if(domainList.size()>0) domain = domainList.at(0); | |
55 |
|
55 | |||
56 | switch(series->type()) |
|
56 | switch(series->type()) | |
57 | { |
|
57 | { | |
58 | case QChartSeries::SeriesTypeLine: { |
|
58 | case QChartSeries::SeriesTypeLine: { | |
59 |
|
59 | |||
60 | QLineChartSeries* xyseries = static_cast<QLineChartSeries*>(series); |
|
60 | QLineChartSeries* xyseries = static_cast<QLineChartSeries*>(series); | |
61 |
|
61 | |||
62 | for (int i = 0; i < xyseries->count(); i++) |
|
62 | for (int i = 0; i < xyseries->count(); i++) | |
63 | { |
|
63 | { | |
64 | qreal x = xyseries->x(i); |
|
64 | qreal x = xyseries->x(i); | |
65 | qreal y = xyseries->y(i); |
|
65 | qreal y = xyseries->y(i); | |
66 | domain.m_minX = qMin(domain.m_minX,x); |
|
66 | domain.m_minX = qMin(domain.m_minX,x); | |
67 | domain.m_minY = qMin(domain.m_minY,y); |
|
67 | domain.m_minY = qMin(domain.m_minY,y); | |
68 | domain.m_maxX = qMax(domain.m_maxX,x); |
|
68 | domain.m_maxX = qMax(domain.m_maxX,x); | |
69 | domain.m_maxY = qMax(domain.m_maxY,y); |
|
69 | domain.m_maxY = qMax(domain.m_maxY,y); | |
70 | } |
|
70 | } | |
71 | break; |
|
71 | break; | |
72 | } |
|
72 | } | |
73 | case QChartSeries::SeriesTypeBar: { |
|
73 | case QChartSeries::SeriesTypeBar: { | |
|
74 | <<<<<<< HEAD | |||
74 | qDebug() << "QChartSeries::SeriesTypeBar"; |
|
75 | qDebug() << "QChartSeries::SeriesTypeBar"; | |
|
76 | ======= | |||
|
77 | >>>>>>> Common naming convention for barcharts | |||
75 | QBarChartSeries* barSeries = static_cast<QBarChartSeries*>(series); |
|
78 | QBarChartSeries* barSeries = static_cast<QBarChartSeries*>(series); | |
76 | qreal x = barSeries->countCategories(); |
|
79 | qreal x = barSeries->countCategories(); | |
77 | qreal y = barSeries->max(); |
|
80 | qreal y = barSeries->max(); | |
78 | domain.m_minX = qMin(domain.m_minX,x); |
|
81 | domain.m_minX = qMin(domain.m_minX,x); | |
79 | domain.m_minY = qMin(domain.m_minY,y); |
|
82 | domain.m_minY = qMin(domain.m_minY,y); | |
80 | domain.m_maxX = qMax(domain.m_maxX,x); |
|
83 | domain.m_maxX = qMax(domain.m_maxX,x); | |
81 | domain.m_maxY = qMax(domain.m_maxY,y); |
|
84 | domain.m_maxY = qMax(domain.m_maxY,y); | |
82 | break; |
|
85 | break; | |
83 | } |
|
86 | } | |
84 | case QChartSeries::SeriesTypeStackedBar: { |
|
87 | case QChartSeries::SeriesTypeStackedBar: { | |
85 | qDebug() << "QChartSeries::SeriesTypeStackedBar"; |
|
88 | qDebug() << "QChartSeries::SeriesTypeStackedBar"; | |
86 |
|
89 | |||
87 | QStackedBarChartSeries* stackedBarSeries = static_cast<QStackedBarChartSeries*>(series); |
|
90 | QStackedBarChartSeries* stackedBarSeries = static_cast<QStackedBarChartSeries*>(series); | |
88 | qreal x = stackedBarSeries->countCategories(); |
|
91 | qreal x = stackedBarSeries->countCategories(); | |
89 | qreal y = stackedBarSeries->maxCategorySum(); |
|
92 | qreal y = stackedBarSeries->maxCategorySum(); | |
90 | domain.m_minX = qMin(domain.m_minX,x); |
|
93 | domain.m_minX = qMin(domain.m_minX,x); | |
91 | domain.m_minY = qMin(domain.m_minY,y); |
|
94 | domain.m_minY = qMin(domain.m_minY,y); | |
92 | domain.m_maxX = qMax(domain.m_maxX,x); |
|
95 | domain.m_maxX = qMax(domain.m_maxX,x); | |
93 | domain.m_maxY = qMax(domain.m_maxY,y); |
|
96 | domain.m_maxY = qMax(domain.m_maxY,y); | |
94 | break; |
|
97 | break; | |
95 | } |
|
98 | } | |
96 | case QChartSeries::SeriesTypePercentBar: { |
|
99 | case QChartSeries::SeriesTypePercentBar: { | |
97 | qDebug() << "QChartSeries::SeriesTypePercentBar"; |
|
100 | qDebug() << "QChartSeries::SeriesTypePercentBar"; | |
98 |
|
101 | |||
99 | QPercentBarChartSeries* percentBarSeries = static_cast<QPercentBarChartSeries*>(series); |
|
102 | QPercentBarChartSeries* percentBarSeries = static_cast<QPercentBarChartSeries*>(series); | |
100 | qreal x = percentBarSeries->countCategories(); |
|
103 | qreal x = percentBarSeries->countCategories(); | |
101 | domain.m_minX = qMin(domain.m_minX,x); |
|
104 | domain.m_minX = qMin(domain.m_minX,x); | |
102 | domain.m_minY = 0; |
|
105 | domain.m_minY = 0; | |
103 | domain.m_maxX = qMax(domain.m_maxX,x); |
|
106 | domain.m_maxX = qMax(domain.m_maxX,x); | |
104 | domain.m_maxY = 100; |
|
107 | domain.m_maxY = 100; | |
105 | break; |
|
108 | break; | |
106 | } |
|
109 | } | |
107 |
|
110 | |||
108 | case QChartSeries::SeriesTypePie: { |
|
111 | case QChartSeries::SeriesTypePie: { | |
109 | QPieSeries *pieSeries = static_cast<QPieSeries *>(series); |
|
112 | QPieSeries *pieSeries = static_cast<QPieSeries *>(series); | |
110 | // TODO: domain stuff |
|
113 | // TODO: domain stuff | |
111 | break; |
|
114 | break; | |
112 | } |
|
115 | } | |
113 |
|
116 | |||
114 | case QChartSeries::SeriesTypeScatter: { |
|
117 | case QChartSeries::SeriesTypeScatter: { | |
115 | QScatterSeries *scatterSeries = qobject_cast<QScatterSeries *>(series); |
|
118 | QScatterSeries *scatterSeries = qobject_cast<QScatterSeries *>(series); | |
116 | Q_ASSERT(scatterSeries); |
|
119 | Q_ASSERT(scatterSeries); | |
117 | foreach (QPointF point, scatterSeries->data()) { |
|
120 | foreach (QPointF point, scatterSeries->data()) { | |
118 | domain.m_minX = qMin(domain.m_minX, point.x()); |
|
121 | domain.m_minX = qMin(domain.m_minX, point.x()); | |
119 | domain.m_maxX = qMax(domain.m_maxX, point.x()); |
|
122 | domain.m_maxX = qMax(domain.m_maxX, point.x()); | |
120 | domain.m_minY = qMin(domain.m_minY, point.y()); |
|
123 | domain.m_minY = qMin(domain.m_minY, point.y()); | |
121 | domain.m_maxY = qMax(domain.m_maxY, point.y()); |
|
124 | domain.m_maxY = qMax(domain.m_maxY, point.y()); | |
122 | } |
|
125 | } | |
123 | break; |
|
126 | break; | |
124 | } |
|
127 | } | |
125 |
|
128 | |||
126 | default: { |
|
129 | default: { | |
127 | qDebug()<<__FUNCTION__<<"type" << series->type()<<"not supported"; |
|
130 | qDebug()<<__FUNCTION__<<"type" << series->type()<<"not supported"; | |
128 | return; |
|
131 | return; | |
129 | break; |
|
132 | break; | |
130 | } |
|
133 | } | |
131 |
|
134 | |||
132 | } |
|
135 | } | |
133 |
|
136 | |||
134 | if(!m_domainMap.contains(axisY)) |
|
137 | if(!m_domainMap.contains(axisY)) | |
135 | { |
|
138 | { | |
136 | emit axisAdded(axisY); |
|
139 | emit axisAdded(axisY); | |
137 | QObject::connect(axisY,SIGNAL(minChanged(qreal)),this,SLOT(handleMinChanged(qreal))); |
|
140 | QObject::connect(axisY,SIGNAL(minChanged(qreal)),this,SLOT(handleMinChanged(qreal))); | |
138 | QObject::connect(axisY,SIGNAL(maxChanged(qreal)),this,SLOT(handleMaxChanged(qreal))); |
|
141 | QObject::connect(axisY,SIGNAL(maxChanged(qreal)),this,SLOT(handleMaxChanged(qreal))); | |
139 | QObject::connect(axisY,SIGNAL(ticksChanged(QChartAxis*)),this,SLOT(handleTickChanged(QChartAxis*))); |
|
142 | QObject::connect(axisY,SIGNAL(ticksChanged(QChartAxis*)),this,SLOT(handleTickChanged(QChartAxis*))); | |
140 | } |
|
143 | } | |
141 | m_domainMap.replace(axisY,domain); |
|
144 | m_domainMap.replace(axisY,domain); | |
142 | m_seriesMap.insert(axisY,series); |
|
145 | m_seriesMap.insert(axisY,series); | |
143 |
|
146 | |||
144 | if(!m_axisXInitialized) |
|
147 | if(!m_axisXInitialized) | |
145 | { |
|
148 | { | |
146 | emit axisAdded(axisX()); |
|
149 | emit axisAdded(axisX()); | |
147 | QObject::connect(axisX(),SIGNAL(minChanged(qreal)),this,SLOT(handleMinChanged(qreal))); |
|
150 | QObject::connect(axisX(),SIGNAL(minChanged(qreal)),this,SLOT(handleMinChanged(qreal))); | |
148 | QObject::connect(axisX(),SIGNAL(maxChanged(qreal)),this,SLOT(handleMaxChanged(qreal))); |
|
151 | QObject::connect(axisX(),SIGNAL(maxChanged(qreal)),this,SLOT(handleMaxChanged(qreal))); | |
149 | QObject::connect(axisX(),SIGNAL(ticksChanged(QChartAxis*)),this,SLOT(handleTickChanged(QChartAxis*))); |
|
152 | QObject::connect(axisX(),SIGNAL(ticksChanged(QChartAxis*)),this,SLOT(handleTickChanged(QChartAxis*))); | |
150 | m_axisXInitialized=true; |
|
153 | m_axisXInitialized=true; | |
151 | } |
|
154 | } | |
152 |
|
155 | |||
153 |
|
156 | |||
154 | emit seriesAdded(series); |
|
157 | emit seriesAdded(series); | |
155 | QStringList ylabels = createLabels(axisY,domain.m_minY,domain.m_maxY); |
|
158 | QStringList ylabels = createLabels(axisY,domain.m_minY,domain.m_maxY); | |
156 | QStringList xlabels = createLabels(axisX(),domain.m_minX,domain.m_maxX); |
|
159 | QStringList xlabels = createLabels(axisX(),domain.m_minX,domain.m_maxX); | |
157 | emit axisLabelsChanged(axisY,ylabels); |
|
160 | emit axisLabelsChanged(axisY,ylabels); | |
158 | emit axisLabelsChanged(axisX(),xlabels); |
|
161 | emit axisLabelsChanged(axisX(),xlabels); | |
159 | emit seriesDomainChanged(series,domain); |
|
162 | emit seriesDomainChanged(series,domain); | |
160 |
|
163 | |||
161 | } |
|
164 | } | |
162 |
|
165 | |||
163 | void ChartDataSet::removeSeries(QChartSeries* series) |
|
166 | void ChartDataSet::removeSeries(QChartSeries* series) | |
164 | { |
|
167 | { | |
165 | QList<QChartAxis*> keys = m_seriesMap.uniqueKeys(); |
|
168 | QList<QChartAxis*> keys = m_seriesMap.uniqueKeys(); | |
166 | foreach(QChartAxis* axis , keys) { |
|
169 | foreach(QChartAxis* axis , keys) { | |
167 | if(m_seriesMap.contains(axis,series)){ |
|
170 | if(m_seriesMap.contains(axis,series)){ | |
168 | emit seriesRemoved(series); |
|
171 | emit seriesRemoved(series); | |
169 | m_seriesMap.remove(axis,series); |
|
172 | m_seriesMap.remove(axis,series); | |
170 | //remove axis if no longer there |
|
173 | //remove axis if no longer there | |
171 | if(!m_seriesMap.contains(axis) && axis != m_axisY){ |
|
174 | if(!m_seriesMap.contains(axis) && axis != m_axisY){ | |
172 | emit axisRemoved(axis); |
|
175 | emit axisRemoved(axis); | |
173 | m_domainMap.remove(axis); |
|
176 | m_domainMap.remove(axis); | |
174 | delete axis; |
|
177 | delete axis; | |
175 | } |
|
178 | } | |
176 | break; |
|
179 | break; | |
177 | } |
|
180 | } | |
178 | } |
|
181 | } | |
179 | } |
|
182 | } | |
180 |
|
183 | |||
181 | bool ChartDataSet::nextDomain() |
|
184 | bool ChartDataSet::nextDomain() | |
182 | { |
|
185 | { | |
183 | int limit = (m_domainMap.values().size()/m_domainMap.uniqueKeys().size())-1; |
|
186 | int limit = (m_domainMap.values().size()/m_domainMap.uniqueKeys().size())-1; | |
184 |
|
187 | |||
185 | if (m_domainIndex < limit) { |
|
188 | if (m_domainIndex < limit) { | |
186 | m_domainIndex++; |
|
189 | m_domainIndex++; | |
187 | setDomain(m_domainIndex); |
|
190 | setDomain(m_domainIndex); | |
188 | return true; |
|
191 | return true; | |
189 | } |
|
192 | } | |
190 | else { |
|
193 | else { | |
191 | return false; |
|
194 | return false; | |
192 | } |
|
195 | } | |
193 | } |
|
196 | } | |
194 |
|
197 | |||
195 | bool ChartDataSet::previousDomain() |
|
198 | bool ChartDataSet::previousDomain() | |
196 | { |
|
199 | { | |
197 | if (m_domainIndex > 0) { |
|
200 | if (m_domainIndex > 0) { | |
198 | m_domainIndex--; |
|
201 | m_domainIndex--; | |
199 | setDomain(m_domainIndex); |
|
202 | setDomain(m_domainIndex); | |
200 | return true; |
|
203 | return true; | |
201 | } |
|
204 | } | |
202 | else { |
|
205 | else { | |
203 | return false; |
|
206 | return false; | |
204 | } |
|
207 | } | |
205 | } |
|
208 | } | |
206 |
|
209 | |||
207 | void ChartDataSet::setDomain(int index) |
|
210 | void ChartDataSet::setDomain(int index) | |
208 | { |
|
211 | { | |
209 | QList<QChartAxis*> domainList = m_domainMap.uniqueKeys(); |
|
212 | QList<QChartAxis*> domainList = m_domainMap.uniqueKeys(); | |
210 | foreach (QChartAxis* axis , domainList) { |
|
213 | foreach (QChartAxis* axis , domainList) { | |
211 | int i = m_domainMap.count(axis) - index -1; |
|
214 | int i = m_domainMap.count(axis) - index -1; | |
212 | Q_ASSERT(i>=0); |
|
215 | Q_ASSERT(i>=0); | |
213 | Domain domain = m_domainMap.values(axis).at(i); |
|
216 | Domain domain = m_domainMap.values(axis).at(i); | |
214 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); |
|
217 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); | |
215 | QList<QChartSeries*> seriesList = m_seriesMap.values(axis); |
|
218 | QList<QChartSeries*> seriesList = m_seriesMap.values(axis); | |
216 | foreach(QChartSeries* series, seriesList) { |
|
219 | foreach(QChartSeries* series, seriesList) { | |
217 | emit seriesDomainChanged(series,domain); |
|
220 | emit seriesDomainChanged(series,domain); | |
218 | } |
|
221 | } | |
219 | emit axisLabelsChanged(axis,labels); |
|
222 | emit axisLabelsChanged(axis,labels); | |
220 | } |
|
223 | } | |
221 |
|
224 | |||
222 | Domain domain = m_domainMap.value(axisY()); |
|
225 | Domain domain = m_domainMap.value(axisY()); | |
223 | QStringList labels = createLabels(axisX(),domain.m_minX,domain.m_maxX); |
|
226 | QStringList labels = createLabels(axisX(),domain.m_minX,domain.m_maxX); | |
224 | emit axisLabelsChanged(axisX(),labels); |
|
227 | emit axisLabelsChanged(axisX(),labels); | |
225 | } |
|
228 | } | |
226 |
|
229 | |||
227 | void ChartDataSet::clearDomains(int toIndex) |
|
230 | void ChartDataSet::clearDomains(int toIndex) | |
228 | { |
|
231 | { | |
229 | Q_ASSERT(toIndex>=0); |
|
232 | Q_ASSERT(toIndex>=0); | |
230 |
|
233 | |||
231 | m_domainIndex = toIndex; |
|
234 | m_domainIndex = toIndex; | |
232 |
|
235 | |||
233 | QList<QChartAxis*> keys = m_domainMap.uniqueKeys(); |
|
236 | QList<QChartAxis*> keys = m_domainMap.uniqueKeys(); | |
234 |
|
237 | |||
235 | foreach (QChartAxis* key , keys) |
|
238 | foreach (QChartAxis* key , keys) | |
236 | { |
|
239 | { | |
237 | QList<Domain> domains = m_domainMap.values(key); |
|
240 | QList<Domain> domains = m_domainMap.values(key); | |
238 | m_domainMap.remove(key); |
|
241 | m_domainMap.remove(key); | |
239 | int i = domains.size() - toIndex - 1; |
|
242 | int i = domains.size() - toIndex - 1; | |
240 | while(i--){ |
|
243 | while(i--){ | |
241 | domains.removeFirst(); |
|
244 | domains.removeFirst(); | |
242 | } |
|
245 | } | |
243 | for(int j=domains.size()-1; j>=0 ;j--) |
|
246 | for(int j=domains.size()-1; j>=0 ;j--) | |
244 | m_domainMap.insert(key,domains.at(j)); |
|
247 | m_domainMap.insert(key,domains.at(j)); | |
245 | } |
|
248 | } | |
246 | } |
|
249 | } | |
247 |
|
250 | |||
248 | void ChartDataSet::addDomain(const QRectF& rect, const QRectF& viewport) |
|
251 | void ChartDataSet::addDomain(const QRectF& rect, const QRectF& viewport) | |
249 | { |
|
252 | { | |
250 | Q_ASSERT(rect.isValid()); |
|
253 | Q_ASSERT(rect.isValid()); | |
251 | Q_ASSERT(viewport.isValid()); |
|
254 | Q_ASSERT(viewport.isValid()); | |
252 |
|
255 | |||
253 | clearDomains(m_domainIndex); |
|
256 | clearDomains(m_domainIndex); | |
254 |
|
257 | |||
255 | QList<QChartAxis*> domainList = m_domainMap.uniqueKeys(); |
|
258 | QList<QChartAxis*> domainList = m_domainMap.uniqueKeys(); | |
256 |
|
259 | |||
257 | foreach (QChartAxis* axis , domainList){ |
|
260 | foreach (QChartAxis* axis , domainList){ | |
258 | Domain domain(m_domainMap.value(axis).subDomain(rect,viewport.width(),viewport.height())); |
|
261 | Domain domain(m_domainMap.value(axis).subDomain(rect,viewport.width(),viewport.height())); | |
259 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); |
|
262 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); | |
260 | QList<QChartSeries*> seriesList = m_seriesMap.values(axis); |
|
263 | QList<QChartSeries*> seriesList = m_seriesMap.values(axis); | |
261 | foreach(QChartSeries* series, seriesList){ |
|
264 | foreach(QChartSeries* series, seriesList){ | |
262 | emit seriesDomainChanged(series,domain); |
|
265 | emit seriesDomainChanged(series,domain); | |
263 | } |
|
266 | } | |
264 | emit axisLabelsChanged(axis,labels); |
|
267 | emit axisLabelsChanged(axis,labels); | |
265 | m_domainMap.insert(axis,domain); |
|
268 | m_domainMap.insert(axis,domain); | |
266 | } |
|
269 | } | |
267 |
|
270 | |||
268 | Domain domain = m_domainMap.value(axisY()); |
|
271 | Domain domain = m_domainMap.value(axisY()); | |
269 | QStringList labels = createLabels(axisX(),domain.m_minX,domain.m_maxX); |
|
272 | QStringList labels = createLabels(axisX(),domain.m_minX,domain.m_maxX); | |
270 | emit axisLabelsChanged(axisX(),labels); |
|
273 | emit axisLabelsChanged(axisX(),labels); | |
271 |
|
274 | |||
272 | m_domainIndex++; |
|
275 | m_domainIndex++; | |
273 | } |
|
276 | } | |
274 |
|
277 | |||
275 | QChartAxis* ChartDataSet::axisY(QChartSeries* series) const |
|
278 | QChartAxis* ChartDataSet::axisY(QChartSeries* series) const | |
276 | { |
|
279 | { | |
277 | if(series == 0) return m_axisY; |
|
280 | if(series == 0) return m_axisY; | |
278 |
|
281 | |||
279 | QList<QChartAxis*> keys = m_seriesMap.uniqueKeys(); |
|
282 | QList<QChartAxis*> keys = m_seriesMap.uniqueKeys(); | |
280 |
|
283 | |||
281 | foreach(QChartAxis* axis , keys) { |
|
284 | foreach(QChartAxis* axis , keys) { | |
282 | if(m_seriesMap.contains(axis,series)){ |
|
285 | if(m_seriesMap.contains(axis,series)){ | |
283 | return axis; |
|
286 | return axis; | |
284 | } |
|
287 | } | |
285 | } |
|
288 | } | |
286 | return 0; |
|
289 | return 0; | |
287 | } |
|
290 | } | |
288 |
|
291 | |||
289 | QStringList ChartDataSet::createLabels(QChartAxis* axis,qreal min, qreal max) |
|
292 | QStringList ChartDataSet::createLabels(QChartAxis* axis,qreal min, qreal max) | |
290 | { |
|
293 | { | |
291 | Q_ASSERT(max>=min); |
|
294 | Q_ASSERT(max>=min); | |
292 |
|
295 | |||
293 | QStringList labels; |
|
296 | QStringList labels; | |
294 |
|
297 | |||
295 | int ticks = axis->ticksCount(); |
|
298 | int ticks = axis->ticksCount(); | |
296 |
|
299 | |||
297 | for(int i=0; i<= ticks; i++){ |
|
300 | for(int i=0; i<= ticks; i++){ | |
298 | qreal value = min + (i * (max - min)/ ticks); |
|
301 | qreal value = min + (i * (max - min)/ ticks); | |
299 | QString label = axis->axisTickLabel(value); |
|
302 | QString label = axis->axisTickLabel(value); | |
300 | if(label.isEmpty()){ |
|
303 | if(label.isEmpty()){ | |
301 | labels << QString::number(value); |
|
304 | labels << QString::number(value); | |
302 | }else{ |
|
305 | }else{ | |
303 | labels << label; |
|
306 | labels << label; | |
304 | } |
|
307 | } | |
305 | } |
|
308 | } | |
306 | return labels; |
|
309 | return labels; | |
307 | } |
|
310 | } | |
308 |
|
311 | |||
309 |
|
312 | |||
310 | void ChartDataSet::handleMinChanged(qreal min) |
|
313 | void ChartDataSet::handleMinChanged(qreal min) | |
311 | { |
|
314 | { | |
312 |
|
315 | |||
313 | } |
|
316 | } | |
314 |
|
317 | |||
315 | void ChartDataSet::handleMaxChanged(qreal max) |
|
318 | void ChartDataSet::handleMaxChanged(qreal max) | |
316 | { |
|
319 | { | |
317 |
|
320 | |||
318 | } |
|
321 | } | |
319 |
|
322 | |||
320 | void ChartDataSet::handleTickChanged(QChartAxis* axis) |
|
323 | void ChartDataSet::handleTickChanged(QChartAxis* axis) | |
321 | { |
|
324 | { | |
322 | Domain domain = m_domainMap.value(axisY()); |
|
325 | Domain domain = m_domainMap.value(axisY()); | |
323 | if(axis==axisX()){ |
|
326 | if(axis==axisX()){ | |
324 | QStringList labels = createLabels(axis,domain.m_minX,domain.m_maxX); |
|
327 | QStringList labels = createLabels(axis,domain.m_minX,domain.m_maxX); | |
325 | emit axisLabelsChanged(axis,labels); |
|
328 | emit axisLabelsChanged(axis,labels); | |
326 | }else{ |
|
329 | }else{ | |
327 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); |
|
330 | QStringList labels = createLabels(axis,domain.m_minY,domain.m_maxY); | |
328 | emit axisLabelsChanged(axis,labels); |
|
331 | emit axisLabelsChanged(axis,labels); | |
329 | } |
|
332 | } | |
330 | } |
|
333 | } | |
331 |
|
334 | |||
332 | #include "moc_chartdataset_p.cpp" |
|
335 | #include "moc_chartdataset_p.cpp" | |
333 |
|
336 | |||
334 | QTCOMMERCIALCHART_END_NAMESPACE |
|
337 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,120 +1,126 | |||||
1 | !include( ../common.pri ):error( Couldn't find the common.pri file! ) |
|
1 | !include( ../common.pri ):error( Couldn't find the common.pri file! ) | |
2 | TARGET = QtCommercialChart |
|
2 | TARGET = QtCommercialChart | |
3 | DESTDIR = $$CHART_BUILD_LIB_DIR |
|
3 | DESTDIR = $$CHART_BUILD_LIB_DIR | |
4 | TEMPLATE = lib |
|
4 | TEMPLATE = lib | |
5 | QT += core \ |
|
5 | QT += core \ | |
6 | gui |
|
6 | gui | |
7 | CONFIG += debug_and_release |
|
7 | CONFIG += debug_and_release | |
8 | CONFIG(debug, debug|release):TARGET = QtCommercialChartd |
|
8 | CONFIG(debug, debug|release):TARGET = QtCommercialChartd | |
9 | SOURCES += \ |
|
9 | SOURCES += \ | |
10 | barchart/bar.cpp \ |
|
10 | barchart/bar.cpp \ | |
11 | barchart/barlabel.cpp \ |
|
11 | barchart/barlabel.cpp \ | |
12 | barchart/barchartmodel.cpp \ |
|
12 | barchart/barchartmodel.cpp \ | |
13 | barchart/separator.cpp \ |
|
13 | barchart/separator.cpp \ | |
14 | barchart/qbarset.cpp \ |
|
14 | barchart/qbarset.cpp \ | |
15 | barchart/qbarcategory.cpp \ |
|
15 | barchart/qbarcategory.cpp \ | |
16 | barchart/qbarchartseries.cpp \ |
|
16 | barchart/qbarchartseries.cpp \ | |
17 | barchart/qpercentbarchartseries.cpp \ |
|
17 | barchart/qpercentbarchartseries.cpp \ | |
18 | barchart/qstackedbarchartseries.cpp \ |
|
18 | barchart/qstackedbarchartseries.cpp \ | |
19 | barchart/barpresenterbase.cpp \ |
|
19 | barchart/barpresenterbase.cpp \ | |
20 | barchart/barpresenter.cpp \ |
|
20 | barchart/barpresenter.cpp \ | |
21 | barchart/stackedbarpresenter.cpp \ |
|
21 | barchart/stackedbarpresenter.cpp \ | |
22 | barchart/percentbarpresenter.cpp \ |
|
22 | barchart/percentbarpresenter.cpp \ | |
23 | linechart/linechartanimationitem.cpp \ |
|
23 | linechart/linechartanimationitem.cpp \ | |
24 | linechart/linechartitem.cpp \ |
|
24 | linechart/linechartitem.cpp \ | |
25 | linechart/qlinechartseries.cpp \ |
|
25 | linechart/qlinechartseries.cpp \ | |
26 | qchart.cpp \ |
|
26 | qchart.cpp \ | |
27 | axisitem.cpp \ |
|
27 | axisitem.cpp \ | |
28 | qchartview.cpp \ |
|
28 | qchartview.cpp \ | |
29 | qchartseries.cpp \ |
|
29 | qchartseries.cpp \ | |
30 | qchartaxis.cpp \ |
|
30 | qchartaxis.cpp \ | |
31 | charttheme.cpp \ |
|
31 | charttheme.cpp \ | |
32 | chartdataset.cpp \ |
|
32 | chartdataset.cpp \ | |
33 | chartpresenter.cpp \ |
|
33 | chartpresenter.cpp \ | |
34 | domain.cpp |
|
34 | domain.cpp | |
35 | PRIVATE_HEADERS += linechart/linechartitem_p.h \ |
|
35 | PRIVATE_HEADERS += linechart/linechartitem_p.h \ | |
36 | linechart/linechartanimationitem_p.h \ |
|
36 | linechart/linechartanimationitem_p.h \ | |
37 | barchart/barlabel_p.h \ |
|
37 | barchart/barlabel_p.h \ | |
38 | barchart/bar_p.h \ |
|
38 | barchart/bar_p.h \ | |
39 | barchart/separator_p.h \ |
|
39 | barchart/separator_p.h \ | |
40 | barchart/barchartmodel_p.h \ |
|
40 | barchart/barchartmodel_p.h \ | |
41 | barchart/barpresenter.h \ |
|
41 | barchart/barpresenter.h \ | |
42 | barchart/stackedbarpresenter.h \ |
|
42 | barchart/stackedbarpresenter.h \ | |
43 | barchart/percentbarpresenter.h \ |
|
43 | barchart/percentbarpresenter.h \ | |
44 | barchart/barpresenterbase.h \ |
|
44 | barchart/barpresenterbase.h \ | |
45 | axisitem_p.h \ |
|
45 | axisitem_p.h \ | |
46 | chartitem_p.h \ |
|
46 | chartitem_p.h \ | |
47 | charttheme_p.h \ |
|
47 | charttheme_p.h \ | |
48 | chartdataset_p.h \ |
|
48 | chartdataset_p.h \ | |
49 | chartpresenter_p.h \ |
|
49 | chartpresenter_p.h \ | |
50 | domain_p.h |
|
50 | domain_p.h | |
51 | PUBLIC_HEADERS += linechart/qlinechartseries.h \ |
|
51 | PUBLIC_HEADERS += linechart/qlinechartseries.h \ | |
52 | barchart/qbarchartseries.h \ |
|
52 | barchart/qbarchartseries.h \ | |
53 | barchart/qstackedbarchartseries.h \ |
|
53 | barchart/qstackedbarchartseries.h \ | |
54 | barchart/qpercentbarchartseries.h \ |
|
54 | barchart/qpercentbarchartseries.h \ | |
|
55 | barchart/barpresenter.h \ | |||
|
56 | barchart/qstackedbarchartseries.h \ | |||
|
57 | barchart/stackedbarpresenter.h \ | |||
|
58 | barchart/qpercentbarchartseries.h \ | |||
|
59 | barchart/percentbarpresenter.h \ | |||
|
60 | barchart/barpresenterbase.h \ | |||
55 | barchart/qbarset.h \ |
|
61 | barchart/qbarset.h \ | |
56 | barchart/qbarcategory.h \ |
|
62 | barchart/qbarcategory.h \ | |
57 | qchartseries.h \ |
|
63 | qchartseries.h \ | |
58 | qchart.h \ |
|
64 | qchart.h \ | |
59 | qchartglobal.h \ |
|
65 | qchartglobal.h \ | |
60 | qchartview.h \ |
|
66 | qchartview.h \ | |
61 | qchartaxis.h |
|
67 | qchartaxis.h | |
62 |
|
68 | |||
63 | include(piechart/piechart.pri) |
|
69 | include(piechart/piechart.pri) | |
64 | include(scatterseries/scatter.pri) |
|
70 | include(scatterseries/scatter.pri) | |
65 |
|
71 | |||
66 | THEMES += themes/chartthemeicy_p.h \ |
|
72 | THEMES += themes/chartthemeicy_p.h \ | |
67 | themes/chartthemegrayscale_p.h \ |
|
73 | themes/chartthemegrayscale_p.h \ | |
68 | themes/chartthemescientific_p.h \ |
|
74 | themes/chartthemescientific_p.h \ | |
69 | themes/chartthemevanilla_p.h |
|
75 | themes/chartthemevanilla_p.h | |
70 | HEADERS += $$PUBLIC_HEADERS |
|
76 | HEADERS += $$PUBLIC_HEADERS | |
71 | HEADERS += $$PRIVATE_HEADERS |
|
77 | HEADERS += $$PRIVATE_HEADERS | |
72 | HEADERS += $$THEMES |
|
78 | HEADERS += $$THEMES | |
73 | INCLUDEPATH += linechart \ |
|
79 | INCLUDEPATH += linechart \ | |
74 | barchart \ |
|
80 | barchart \ | |
75 | themes \ |
|
81 | themes \ | |
76 | . |
|
82 | . | |
77 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
83 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib | |
78 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
84 | MOC_DIR = $$CHART_BUILD_DIR/lib | |
79 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
85 | UI_DIR = $$CHART_BUILD_DIR/lib | |
80 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
86 | RCC_DIR = $$CHART_BUILD_DIR/lib | |
81 | DEFINES += QTCOMMERCIALCHART_LIBRARY |
|
87 | DEFINES += QTCOMMERCIALCHART_LIBRARY | |
82 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
88 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart | |
83 | public_headers.files = $$PUBLIC_HEADERS |
|
89 | public_headers.files = $$PUBLIC_HEADERS | |
84 | target.path = $$[QT_INSTALL_LIBS] |
|
90 | target.path = $$[QT_INSTALL_LIBS] | |
85 | INSTALLS += target \ |
|
91 | INSTALLS += target \ | |
86 | public_headers |
|
92 | public_headers | |
87 | install_build_public_headers.name = bild_public_headers |
|
93 | install_build_public_headers.name = bild_public_headers | |
88 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
94 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h | |
89 | install_build_public_headers.input = PUBLIC_HEADERS |
|
95 | install_build_public_headers.input = PUBLIC_HEADERS | |
90 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
96 | install_build_public_headers.commands = $$QMAKE_COPY \ | |
91 | ${QMAKE_FILE_NAME} \ |
|
97 | ${QMAKE_FILE_NAME} \ | |
92 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
98 | $$CHART_BUILD_PUBLIC_HEADER_DIR | |
93 | install_build_public_headers.CONFIG += target_predeps \ |
|
99 | install_build_public_headers.CONFIG += target_predeps \ | |
94 | no_link |
|
100 | no_link | |
95 | install_build_private_headers.name = bild_private_headers |
|
101 | install_build_private_headers.name = bild_private_headers | |
96 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
102 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h | |
97 | install_build_private_headers.input = PRIVATE_HEADERS |
|
103 | install_build_private_headers.input = PRIVATE_HEADERS | |
98 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
104 | install_build_private_headers.commands = $$QMAKE_COPY \ | |
99 | ${QMAKE_FILE_NAME} \ |
|
105 | ${QMAKE_FILE_NAME} \ | |
100 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
106 | $$CHART_BUILD_PRIVATE_HEADER_DIR | |
101 | install_build_private_headers.CONFIG += target_predeps \ |
|
107 | install_build_private_headers.CONFIG += target_predeps \ | |
102 | no_link |
|
108 | no_link | |
103 | QMAKE_EXTRA_COMPILERS += install_build_public_headers install_build_private_headers |
|
109 | QMAKE_EXTRA_COMPILERS += install_build_public_headers install_build_private_headers | |
104 | chartversion.target = qchartversion_p.h |
|
110 | chartversion.target = qchartversion_p.h | |
105 | chartversion.commands = @echo \ |
|
111 | chartversion.commands = @echo \ | |
106 | "build_time" \ |
|
112 | "build_time" \ | |
107 | > \ |
|
113 | > \ | |
108 | $$chartversion.target; |
|
114 | $$chartversion.target; | |
109 | chartversion.depends = $$HEADERS \ |
|
115 | chartversion.depends = $$HEADERS \ | |
110 | $$SOURCES |
|
116 | $$SOURCES | |
111 | PRE_TARGETDEPS += qchartversion_p.h |
|
117 | PRE_TARGETDEPS += qchartversion_p.h | |
112 | QMAKE_CLEAN += qchartversion_p.h |
|
118 | QMAKE_CLEAN += qchartversion_p.h | |
113 | QMAKE_EXTRA_TARGETS += chartversion |
|
119 | QMAKE_EXTRA_TARGETS += chartversion | |
114 | unix:QMAKE_DISTCLEAN += -r \ |
|
120 | unix:QMAKE_DISTCLEAN += -r \ | |
115 | $$CHART_BUILD_HEADER_DIR \ |
|
121 | $$CHART_BUILD_HEADER_DIR \ | |
116 | $$CHART_BUILD_LIB_DIR |
|
122 | $$CHART_BUILD_LIB_DIR | |
117 | win32:QMAKE_DISTCLEAN += /Q \ |
|
123 | win32:QMAKE_DISTCLEAN += /Q \ | |
118 | $$CHART_BUILD_HEADER_DIR \ |
|
124 | $$CHART_BUILD_HEADER_DIR \ | |
119 | $$CHART_BUILD_LIB_DIR |
|
125 | $$CHART_BUILD_LIB_DIR | |
120 |
|
126 |
General Comments 0
You need to be logged in to leave comments.
Login now