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