##// END OF EJS Templates
added stacked bar chart
sauimone -
r94:6732dc48e5e9
parent child
Show More
@@ -1,91 +1,79
1 #include <QDebug>
1 #include <QDebug>
2 #include "barchartseries.h"
2 #include "barchartseries.h"
3 #include "bargroup.h"
3 #include "bargroup.h"
4 QTCOMMERCIALCHART_BEGIN_NAMESPACE
4 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5
5
6 BarChartSeries::BarChartSeries(QObject *parent)
6 BarChartSeries::BarChartSeries(QObject *parent)
7 : QChartSeries(parent)
7 : QChartSeries(parent)
8 {
8 {
9 }
9 }
10
10
11 bool BarChartSeries::setData(QAbstractItemModel* model)
11 bool BarChartSeries::setData(QAbstractItemModel* model)
12 {
12 {
13 mModel = model;
13 mModel = model;
14 }
14 }
15
15
16 int BarChartSeries::min()
16 int BarChartSeries::min()
17 {
17 {
18 Q_ASSERT(mModel->rowCount() > 0);
18 Q_ASSERT(mModel->rowCount() > 0);
19 Q_ASSERT(mModel->columnCount() > 0);
19 Q_ASSERT(mModel->columnCount() > 0);
20
20
21 // TODO: make min and max members and update them when data changes.
21 // TODO: make min and max members and update them when data changes.
22 // This is slower since they are checked every time, even if data is same since previous call.
22 // This is slower since they are checked every time, even if data is same since previous call.
23 QModelIndex modelIndex = mModel->index(0,0);
23 int min = INT_MAX;
24 int min = mModel->data(modelIndex).toInt();
25
24
26 for (int i=0; i <mModel->rowCount(); i++) {
25 for (int i=0; i <mModel->rowCount(); i++) {
27 for(int j=0; j<mModel->columnCount(); j++) {
26 for(int j=0; j<mModel->columnCount(); j++) {
28 modelIndex = mModel->index(i,j);
27 int temp = mModel->data(mModel->index(i,j)).toInt();
29 int temp = mModel->data(modelIndex).toInt();
30 if (temp < min) {
28 if (temp < min) {
31 min = temp;
29 min = temp;
32 }
30 }
33 }
31 }
34 }
32 }
35 return min;
33 return min;
36 }
34 }
37
35
38 int BarChartSeries::max()
36 int BarChartSeries::max()
39 {
37 {
40 Q_ASSERT(mModel->rowCount() > 0);
38 Q_ASSERT(mModel->rowCount() > 0);
41 Q_ASSERT(mModel->columnCount() > 0);
39 Q_ASSERT(mModel->columnCount() > 0);
42
40
43 // TODO: make min and max members and update them when data changes.
41 // TODO: make min and max members and update them when data changes.
44 // This is slower since they are checked every time, even if data is same since previous call.
42 // This is slower since they are checked every time, even if data is same since previous call.
45 QModelIndex modelIndex = mModel->index(0,0);
43 int max = INT_MIN;
46 int max = mModel->data(modelIndex).toInt();
47
44
48 for (int i=0; i <mModel->rowCount(); i++) {
45 for (int i=0; i <mModel->rowCount(); i++) {
49 for(int j=0; j<mModel->columnCount(); j++) {
46 for(int j=0; j<mModel->columnCount(); j++) {
50 modelIndex = mModel->index(i,j);
47 int temp = mModel->data(mModel->index(i,j)).toInt();
51 int temp = mModel->data(modelIndex).toInt();
52 if (temp > max) {
48 if (temp > max) {
53 max = temp;
49 max = temp;
54 }
50 }
55 }
51 }
56 }
52 }
57 return max;
53 return max;
58 }
54 }
59
55
60
56
61 int BarChartSeries::countSeries()
57 int BarChartSeries::countSeries()
62 {
58 {
63 return mModel->rowCount();
59 return mModel->rowCount();
64 }
60 }
65
61
66 int BarChartSeries::countItemsInSeries()
62 int BarChartSeries::countColumns()
67 {
63 {
68 return mModel->columnCount();
64 return mModel->columnCount();
69 }
65 }
70
66
71 int BarChartSeries::countTotalItems()
67 int BarChartSeries::countTotalItems()
72 {
68 {
73 return mModel->rowCount() * mModel->columnCount();
69 return mModel->rowCount() * mModel->columnCount();
74 }
70 }
75
71
76 int BarChartSeries::valueAt(int series, int item)
72 int BarChartSeries::valueAt(int row, int column)
77 {
73 {
78 QModelIndex index = mModel->index(series,item);
74 return mModel->data(mModel->index(row,column)).toInt();
79 return mModel->data(index).toInt();
80 }
75 }
81
76
82 /*
83 void BarChartSeries::chartSizeChanged(QRectF rect)
84 {
85 qDebug() << "barchart size changed:" << rect;
86 // mBarGroup->resize(rect.toRect().width(), rect.toRect().height());
87 }
88 */
89 #include "moc_barchartseries.cpp"
77 #include "moc_barchartseries.cpp"
90
78
91 QTCOMMERCIALCHART_END_NAMESPACE
79 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,49 +1,49
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 <QRectF>
5 //#include <QRectF>
6 #include <QAbstractItemModel>
6 #include <QAbstractItemModel>
7 #include "qchartseries.h"
7 #include "qchartseries.h"
8 #include "qchartglobal.h"
8 #include "qchartglobal.h"
9
9
10 // TODO: Can this class be combined with series?
10 // TODO: Can this class be combined with series?
11 class BarGroup;
11 class BarGroup;
12
12
13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
14
14
15 // Container for series
15 // Container for series
16 class QTCOMMERCIALCHART_EXPORT BarChartSeries : public QChartSeries
16 class QTCOMMERCIALCHART_EXPORT BarChartSeries : public QChartSeries
17 {
17 {
18 Q_OBJECT
18 Q_OBJECT
19 public:
19 public:
20 BarChartSeries(QObject* parent=0);
20 BarChartSeries(QObject* parent=0);
21
21
22 // from QChartSeries
22 // from QChartSeries
23 virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; }
23 virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; }
24
24
25 // TODO: Better data model?
25 // TODO: Better data model?
26 virtual bool setData(QAbstractItemModel* model);
26 virtual bool setData(QAbstractItemModel* model);
27
27
28 // Methods to find out minimum and maximum values of data
28 // Methods to find out minimum and maximum values of data
29 int min();
29 int min();
30 int max();
30 int max();
31 int countSeries();
31 int countSeries();
32 int countItemsInSeries(); // Count items in one series.
32 int countColumns(); // Count items in one series.
33 int countTotalItems();
33 int countTotalItems();
34 int valueAt(int series, int item);
34 int valueAt(int row, int column);
35
35
36 public Q_SLOTS:
36 public Q_SLOTS:
37
37
38 // TODO: wrong place for this... series don't know anything about layout
38 // TODO: wrong place for this... series don't know anything about layout
39 // void chartSizeChanged(QRectF rect);
39 // void chartSizeChanged(QRectF rect);
40
40
41 private:
41 private:
42
42
43 QAbstractItemModel* mModel;
43 QAbstractItemModel* mModel;
44 BarGroup* mBarGroup;
44 BarGroup* mBarGroup;
45 };
45 };
46
46
47 QTCOMMERCIALCHART_END_NAMESPACE
47 QTCOMMERCIALCHART_END_NAMESPACE
48
48
49 #endif // BARCHARTSERIES_H
49 #endif // BARCHARTSERIES_H
@@ -1,133 +1,127
1 #include "bargroup.h"
1 #include "bargroup.h"
2 #include "bar.h"
2 #include "bar.h"
3 #include <QDebug>
3 #include <QDebug>
4
4
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
6
6
7 // TODO: singleton?
8 //BarGroup* BarGroup::mBarGroupInstance = NULL;
9
10 //BarGroup::BarGroup(QGraphicsItem *parent) :
11 // QGraphicsItem(parent)
12 // ,mSeries(series)
13 BarGroup::BarGroup(BarChartSeries& series, QGraphicsItem *parent) :
7 BarGroup::BarGroup(BarChartSeries& series, QGraphicsItem *parent) :
14 ChartItem(parent)
8 ChartItem(parent)
15 ,mSeries(series)
9 ,mSeries(series)
16 ,mLayoutSet(false)
10 ,mLayoutSet(false)
17 ,mLayoutDirty(true)
11 ,mLayoutDirty(true)
18 ,mBarDefaultWidth(10)
12 ,mBarDefaultWidth(10)
19 {
13 {
20 dataChanged();
14 dataChanged();
21 }
15 }
22
16
23
17
24 void BarGroup::setSize(const QSize& size)
18 void BarGroup::setSize(const QSize& size)
25 {
19 {
26 qDebug() << "BarGroup::setSize";
20 qDebug() << "BarGroup::setSize";
27 mWidth = size.width();
21 mWidth = size.width();
28 mHeight = size.height();
22 mHeight = size.height();
29 layoutChanged();
23 layoutChanged();
30 mLayoutSet = true;
24 mLayoutSet = true;
31 }
25 }
32
26
33 void BarGroup::setPlotDomain(const PlotDomain& data)
27 void BarGroup::setPlotDomain(const PlotDomain& data)
34 {
28 {
35 qDebug() << "BarGroup::setPlotDomain";
29 qDebug() << "BarGroup::setPlotDomain";
36 // TODO:
30 // TODO:
37 }
31 }
38
32
39 void BarGroup::setBarWidth( int w )
33 void BarGroup::setBarWidth( int w )
40 {
34 {
41 mBarDefaultWidth = w;
35 mBarDefaultWidth = w;
42 }
36 }
43
37
44 int BarGroup::addColor( QColor color )
38 int BarGroup::addColor( QColor color )
45 {
39 {
46 int colorIndex = mColors.count();
40 int colorIndex = mColors.count();
47 mColors.append(color);
41 mColors.append(color);
48 return colorIndex;
42 return colorIndex;
49 }
43 }
50
44
51 void BarGroup::resetColors()
45 void BarGroup::resetColors()
52 {
46 {
53 mColors.clear();
47 mColors.clear();
54 }
48 }
55
49
56 void BarGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
50 void BarGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
57 {
51 {
58 if (!mLayoutSet) {
52 if (!mLayoutSet) {
59 qDebug() << "QBarChart::paint called without layout set. Aborting.";
53 qDebug() << "QBarChart::paint called without layout set. Aborting.";
60 return;
54 return;
61 }
55 }
62 if (mLayoutDirty) {
56 if (mLayoutDirty) {
63 // Layout or data has changed. Need to redraw.
57 // Layout or data has changed. Need to redraw.
64 foreach(QGraphicsItem* i, childItems()) {
58 foreach(QGraphicsItem* i, childItems()) {
65 i->paint(painter,option,widget);
59 i->paint(painter,option,widget);
66 }
60 }
67 }
61 }
68 }
62 }
69
63
70 QRectF BarGroup::boundingRect() const
64 QRectF BarGroup::boundingRect() const
71 {
65 {
72 return QRectF(0,0,mWidth,mHeight);
66 return QRectF(0,0,mWidth,mHeight);
73 }
67 }
74
68
75
69
76 void BarGroup::dataChanged()
70 void BarGroup::dataChanged()
77 {
71 {
78 qDebug() << "QBarChart::dataChanged mSeries";
72 qDebug() << "QBarChart::dataChanged mSeries";
79
73
80 // Find out maximum and minimum of all series
74 // Find out maximum and minimum of all series
81 mMax = mSeries.max();
75 mMax = mSeries.max();
82 mMin = mSeries.min();
76 mMin = mSeries.min();
83
77
84 // Delete old bars
78 // Delete old bars
85 // Is this correct way to delete childItems?
79 // Is this correct way to delete childItems?
86 foreach (QGraphicsItem* item, childItems()) {
80 foreach (QGraphicsItem* item, childItems()) {
87 delete item;
81 delete item;
88 }
82 }
89
83
90 // Create new graphic items for bars
84 // Create new graphic items for bars
91 int totalItems = mSeries.countTotalItems();
85 int totalItems = mSeries.countTotalItems();
92 for (int i=0; i<totalItems; i++) {
86 for (int i=0; i<totalItems; i++) {
93 Bar *bar = new Bar(this);
87 Bar *bar = new Bar(this);
94 childItems().append(bar);
88 childItems().append(bar);
95 }
89 }
96
90
97 mLayoutDirty = true;
91 mLayoutDirty = true;
98 }
92 }
99
93
100 void BarGroup::layoutChanged()
94 void BarGroup::layoutChanged()
101 {
95 {
102 // Scale bars to new layout
96 // Scale bars to new layout
103 // Layout for bars:
97 // Layout for bars:
104 if (mSeries.countSeries() <= 0) {
98 if (mSeries.countSeries() <= 0) {
105 // Nothing to do.
99 // Nothing to do.
106 return;
100 return;
107 }
101 }
108
102
109 // TODO: better way to auto-layout
103 // TODO: better way to auto-layout
110 int count = mSeries.countItemsInSeries();
104 int count = mSeries.countColumns();
111 int posStep = (mWidth / (count+1));
105 int posStep = (mWidth / (count+1));
112 int startPos = (mWidth / (count+1)) - mSeries.countSeries() * mBarDefaultWidth /2;
106 int startPos = (mWidth / (count+1)) - mSeries.countSeries() * mBarDefaultWidth /2;
113 qDebug() << "startpos" << startPos;
107 qDebug() << "startpos" << startPos;
114
108
115 // Scaling.
109 // Scaling.
116 int itemIndex(0);
110 int itemIndex(0);
117 for (int series = 0; series < mSeries.countSeries(); series++) {
111 for (int series = 0; series < mSeries.countSeries(); series++) {
118 for (int item=0; item < mSeries.countItemsInSeries(); item++) {
112 for (int item=0; item < mSeries.countColumns(); item++) {
119 qDebug() << itemIndex;
113 qDebug() << itemIndex;
120 int barHeight = mSeries.valueAt(series, item) * mHeight / mMax;
114 int barHeight = mSeries.valueAt(series, item) * mHeight / mMax;
121 Bar* bar = reinterpret_cast<Bar*> (childItems().at(itemIndex));
115 Bar* bar = reinterpret_cast<Bar*> (childItems().at(itemIndex));
122
116
123 // TODO: width settable per bar?
117 // TODO: width settable per bar?
124 bar->resize(mBarDefaultWidth, barHeight);
118 bar->resize(mBarDefaultWidth, barHeight);
125 bar->setColor(mColors.at(series));
119 bar->setColor(mColors.at(series));
126 bar->setPos(item*posStep+startPos + series * mBarDefaultWidth, mHeight);
120 bar->setPos(item*posStep+startPos + series * mBarDefaultWidth, mHeight);
127 itemIndex++;
121 itemIndex++;
128 }
122 }
129 }
123 }
130 mLayoutDirty = true;
124 mLayoutDirty = true;
131 }
125 }
132
126
133 QTCOMMERCIALCHART_END_NAMESPACE
127 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,71 +1,54
1 #ifndef QBARCHART_H
1 #ifndef QBARGROUP_H
2 #define QBARCHART_H
2 #define QBARGROUP_H
3
3
4 #include "chartitem_p.h"
4 #include "chartitem_p.h"
5 #include "bar.h"
5 #include "bar.h"
6 #include "barchartseries.h"
6 #include "barchartseries.h"
7
7
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
9
9
10 // TODO: Better name for this? The function of this class is to know where each bar in series is laid out.
11 //class BarGroup : public QGraphicsItemGroup
12
13 class BarGroup : public ChartItem
10 class BarGroup : public ChartItem
14 {
11 {
15 /* // TODO: implement as singleton?
16 private:
17 static BarGroup* mBarGroupInstance;
18
19 public:
20 static BarGroup* instance()
21 {
22 if (mBarGroupInstance == NULL) {
23 mBarGroupInstance = new BarGroup();
24 }
25 return mBarGroupInstance;
26 }
27 private:
28 */
29 public:
12 public:
30 explicit BarGroup(BarChartSeries& series, QGraphicsItem *parent = 0);
13 explicit BarGroup(BarChartSeries& series, QGraphicsItem *parent = 0);
31
14
32 // From ChartItem
15 // From ChartItem
33 virtual void setSize(const QSize& size);
16 virtual void setSize(const QSize& size);
34 virtual void setPlotDomain(const PlotDomain& data);
17 virtual void setPlotDomain(const PlotDomain& data);
35
18
36 // Layout "api"
19 // Layout "api"
37 void setPos(qreal x, qreal y);
20 void setPos(qreal x, qreal y);
38 void setBarWidth( int w ); // Default width for each bar
21 void setBarWidth( int w ); // Default width for each bar
39
22
40 int addColor( QColor color );
23 int addColor( QColor color );
41 void resetColors();
24 void resetColors();
42
25
43 // From QGraphicsItem
26 // From QGraphicsItem
44 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
27 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
45 QRectF boundingRect() const;
28 QRectF boundingRect() const;
46
29
47 private:
30 private:
48
31
49 void dataChanged(); // data of series has changed -> need to recalculate bar sizes
32 void dataChanged(); // data of series has changed -> need to recalculate bar sizes
50 void layoutChanged(); // layout has changed -> need to recalculate bar sizes
33 void layoutChanged(); // layout has changed -> need to recalculate bar sizes
51
34
52 private:
35 private:
53
36
54 // Data
37 // Data
55 BarChartSeries& mSeries;
38 BarChartSeries& mSeries;
56 int mMin; // Min and max values of data. (updated when data is changed, used when drawing)
39 int mMin; // Min and max values of data. (updated when data is changed, used when drawing)
57 int mMax;
40 int mMax;
58
41
59 int mHeight; // Layout spesific
42 int mHeight; // Layout spesific
60 int mWidth;
43 int mWidth;
61 int mBarDefaultWidth;
44 int mBarDefaultWidth;
62
45
63 bool mLayoutSet; // True, if component has been laid out.
46 bool mLayoutSet; // True, if component has been laid out.
64 bool mLayoutDirty;
47 bool mLayoutDirty;
65
48
66 QList<QColor> mColors; // List of colors for series for now
49 QList<QColor> mColors; // List of colors for series for now
67 };
50 };
68
51
69 QTCOMMERCIALCHART_END_NAMESPACE
52 QTCOMMERCIALCHART_END_NAMESPACE
70
53
71 #endif // QBARCHART_H
54 #endif // QBARGROUP_H
@@ -1,47 +1,48
1 #ifndef QCHARTSERIES_H
1 #ifndef QCHARTSERIES_H
2 #define QCHARTSERIES_H
2 #define QCHARTSERIES_H
3
3
4 #include "qchartglobal.h"
4 #include "qchartglobal.h"
5 #include <QObject>
5 #include <QObject>
6 #include <QAbstractItemModel>
6 #include <QAbstractItemModel>
7
7
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
9
9
10 class QTCOMMERCIALCHART_EXPORT QChartSeries : public QObject
10 class QTCOMMERCIALCHART_EXPORT QChartSeries : public QObject
11 {
11 {
12 Q_OBJECT
12 Q_OBJECT
13 public:
13 public:
14 enum QChartSeriesType {
14 enum QChartSeriesType {
15 SeriesTypeLine = 0,
15 SeriesTypeLine = 0,
16 // SeriesTypeArea,
16 // SeriesTypeArea,
17 SeriesTypeBar,
17 SeriesTypeBar,
18 SeriesTypeStackedBar,
18 SeriesTypePie,
19 SeriesTypePie,
19 SeriesTypeScatter
20 SeriesTypeScatter
20 // SeriesTypeSpline
21 // SeriesTypeSpline
21 };
22 };
22
23
23 protected:
24 protected:
24 QChartSeries(QObject *parent = 0):QObject(parent){};
25 QChartSeries(QObject *parent = 0):QObject(parent){};
25
26
26 public:
27 public:
27 virtual ~QChartSeries(){};
28 virtual ~QChartSeries(){};
28
29
29 // Factory method
30 // Factory method
30 static QChartSeries* create(QChartSeriesType type, QObject* parent = 0 );
31 static QChartSeries* create(QChartSeriesType type, QObject* parent = 0 );
31
32
32 // Pure virtual
33 // Pure virtual
33 virtual QChartSeriesType type() const = 0;
34 virtual QChartSeriesType type() const = 0;
34
35
35 virtual bool setData(QList<int> data) { return false; }
36 virtual bool setData(QList<int> data) { return false; }
36 virtual bool setData(QList<qreal> data) { return false; }
37 virtual bool setData(QList<qreal> data) { return false; }
37 virtual bool setData(QList<qreal> x, QList<qreal> y){ return false; }
38 virtual bool setData(QList<qreal> x, QList<qreal> y){ return false; }
38
39
39 // Prototype for data model. TODO: remove the other setData methods and use something like this for now?
40 // Prototype for data model. TODO: remove the other setData methods and use something like this for now?
40 virtual bool setData(QAbstractItemModel* model) { return false; }
41 virtual bool setData(QAbstractItemModel* model) { return false; }
41
42
42 };
43 };
43
44
44 QTCOMMERCIALCHART_END_NAMESPACE
45 QTCOMMERCIALCHART_END_NAMESPACE
45
46
46 #endif
47 #endif
47
48
@@ -1,91 +1,95
1 !include( ../common.pri ) {
1 !include( ../common.pri ) {
2 error( Couldn't find the common.pri file! )
2 error( Couldn't find the common.pri file! )
3 }
3 }
4
4
5 TARGET = QtCommercialChart
5 TARGET = QtCommercialChart
6 DESTDIR = $$CHART_BUILD_LIB_DIR
6 DESTDIR = $$CHART_BUILD_LIB_DIR
7 TEMPLATE = lib
7 TEMPLATE = lib
8 QT += core \
8 QT += core \
9 gui
9 gui
10
10
11 CONFIG += debug_and_release
11 CONFIG += debug_and_release
12 CONFIG(debug, debug|release):TARGET = QtCommercialChartd
12 CONFIG(debug, debug|release):TARGET = QtCommercialChartd
13
13
14 SOURCES += \
14 SOURCES += \
15 barchart/barchartseries.cpp \
15 barchart/barchartseries.cpp \
16 barchart/bargroup.cpp \
16 barchart/bargroup.cpp \
17 barchart/bar.cpp \
17 barchart/bar.cpp \
18 xylinechart/qxychartseries.cpp \
18 xylinechart/qxychartseries.cpp \
19 xylinechart/xylinechartitem.cpp \
19 xylinechart/xylinechartitem.cpp \
20 plotdomain.cpp \
20 plotdomain.cpp \
21 qscatterseries.cpp \
21 qscatterseries.cpp \
22 qpieseries.cpp \
22 qpieseries.cpp \
23 qchart.cpp \
23 qchart.cpp \
24 axisitem.cpp \
24 axisitem.cpp \
25 qchartwidget.cpp \
25 qchartwidget.cpp \
26 pieslice.cpp \
26 pieslice.cpp \
27 qchartview.cpp \
27 qchartview.cpp \
28 qchartseries.cpp \
28 qchartseries.cpp \
29 qchartaxis.cpp
29 qchartaxis.cpp \
30 barchart/stackedbarchartseries.cpp \
31 barchart/stackedbargroup.cpp
30
32
31 PRIVATE_HEADERS += \
33 PRIVATE_HEADERS += \
32 xylinechart/xylinechartitem_p.h \
34 xylinechart/xylinechartitem_p.h \
33 plotdomain_p.h \
35 plotdomain_p.h \
34 qscatterseries_p.h \
36 qscatterseries_p.h \
35 pieslice.h \
37 pieslice.h \
36 axisitem_p.h \
38 axisitem_p.h \
37 chartitem_p.h
39 chartitem_p.h
38
40
39 PUBLIC_HEADERS += \
41 PUBLIC_HEADERS += \
40 qchartseries.h \
42 qchartseries.h \
41 qscatterseries.h \
43 qscatterseries.h \
42 qpieseries.h \
44 qpieseries.h \
43 qchart.h \
45 qchart.h \
44 qchartwidget.h \
46 qchartwidget.h \
45 qchartglobal.h \
47 qchartglobal.h \
46 xylinechart/qxychartseries.h \
48 xylinechart/qxychartseries.h \
47 barchart/barchartseries.h \
49 barchart/barchartseries.h \
48 barchart/bargroup.h \
50 barchart/bargroup.h \
49 qchartview.h \
51 qchartview.h \
50 qchartaxis.h
52 qchartaxis.h
51
53
52 HEADERS += $$PUBLIC_HEADERS
54 HEADERS += $$PUBLIC_HEADERS \
55 barchart/stackedbarchartseries.h \
56 barchart/stackedbargroup.h
53 HEADERS += $$PRIVATE_HEADERS
57 HEADERS += $$PRIVATE_HEADERS
54
58
55 INCLUDEPATH += xylinechart \
59 INCLUDEPATH += xylinechart \
56 barchart \
60 barchart \
57 .
61 .
58
62
59 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
63 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
60 MOC_DIR = $$CHART_BUILD_DIR/lib
64 MOC_DIR = $$CHART_BUILD_DIR/lib
61 UI_DIR = $$CHART_BUILD_DIR/lib
65 UI_DIR = $$CHART_BUILD_DIR/lib
62 RCC_DIR = $$CHART_BUILD_DIR/lib
66 RCC_DIR = $$CHART_BUILD_DIR/lib
63
67
64
68
65 DEFINES += QTCOMMERCIALCHART_LIBRARY
69 DEFINES += QTCOMMERCIALCHART_LIBRARY
66
70
67 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
71 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
68 public_headers.files = $$PUBLIC_HEADERS
72 public_headers.files = $$PUBLIC_HEADERS
69 target.path = $$[QT_INSTALL_LIBS]
73 target.path = $$[QT_INSTALL_LIBS]
70 INSTALLS += target \
74 INSTALLS += target \
71 public_headers
75 public_headers
72
76
73
77
74 install_build_headers.name = bild_headers
78 install_build_headers.name = bild_headers
75 install_build_headers.output = $$CHART_BUILD_HEADER_DIR/${QMAKE_FILE_BASE}.h
79 install_build_headers.output = $$CHART_BUILD_HEADER_DIR/${QMAKE_FILE_BASE}.h
76 install_build_headers.input = PUBLIC_HEADERS
80 install_build_headers.input = PUBLIC_HEADERS
77 install_build_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} $$CHART_BUILD_HEADER_DIR
81 install_build_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} $$CHART_BUILD_HEADER_DIR
78 install_build_headers.CONFIG += target_predeps no_link
82 install_build_headers.CONFIG += target_predeps no_link
79 QMAKE_EXTRA_COMPILERS += install_build_headers
83 QMAKE_EXTRA_COMPILERS += install_build_headers
80
84
81 chartversion.target = qchartversion_p.h
85 chartversion.target = qchartversion_p.h
82 chartversion.commands = @echo "build_time" > $$chartversion.target;
86 chartversion.commands = @echo "build_time" > $$chartversion.target;
83 chartversion.depends = $$HEADERS $$SOURCES
87 chartversion.depends = $$HEADERS $$SOURCES
84 PRE_TARGETDEPS += qchartversion_p.h
88 PRE_TARGETDEPS += qchartversion_p.h
85 QMAKE_CLEAN+= qchartversion_p.h
89 QMAKE_CLEAN+= qchartversion_p.h
86 QMAKE_EXTRA_TARGETS += chartversion
90 QMAKE_EXTRA_TARGETS += chartversion
87
91
88 unix:QMAKE_DISTCLEAN += -r $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR
92 unix:QMAKE_DISTCLEAN += -r $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR
89 win32:QMAKE_DISTCLEAN += /Q $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR
93 win32:QMAKE_DISTCLEAN += /Q $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR
90
94
91
95
General Comments 0
You need to be logged in to leave comments. Login now