@@ -0,0 +1,14 | |||||
|
1 | ||||
|
2 | #include "qchartaxis.h" | |||
|
3 | ||||
|
4 | QChartAxis::QChartAxis() | |||
|
5 | { | |||
|
6 | // TODO Auto-generated constructor stub | |||
|
7 | ||||
|
8 | } | |||
|
9 | ||||
|
10 | QChartAxis::~QChartAxis() | |||
|
11 | { | |||
|
12 | // TODO Auto-generated destructor stub | |||
|
13 | } | |||
|
14 |
@@ -0,0 +1,11 | |||||
|
1 | #ifndef QCHARTAXIS_H_ | |||
|
2 | #define QCHARTAXIS_H_ | |||
|
3 | ||||
|
4 | class QChartAxis | |||
|
5 | { | |||
|
6 | public: | |||
|
7 | QChartAxis(); | |||
|
8 | virtual ~QChartAxis(); | |||
|
9 | }; | |||
|
10 | ||||
|
11 | #endif /* QCHARTAXIS_H_ */ |
@@ -1,86 +1,92 | |||||
1 | #ifndef CHART_H |
|
1 | #ifndef CHART_H | |
2 | #define CHART_H |
|
2 | #define CHART_H | |
3 |
|
3 | |||
4 | #include <qchartglobal.h> |
|
4 | #include <qchartglobal.h> | |
5 | #include <qchartseries.h> |
|
5 | #include <qchartseries.h> | |
6 | #include <QGraphicsObject> |
|
6 | #include <QGraphicsObject> | |
7 | #include <QLinearGradient> |
|
7 | #include <QLinearGradient> | |
8 |
|
8 | |||
9 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
9 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
10 |
|
10 | |||
11 | class AxisItem; |
|
11 | class AxisItem; | |
12 | class QChartSeries; |
|
12 | class QChartSeries; | |
13 | class PlotDomain; |
|
13 | class PlotDomain; | |
14 | class ChartItem; |
|
14 | class ChartItem; | |
15 | class BarGroup; |
|
15 | class BarGroup; | |
|
16 | class QChartAxis; | |||
16 |
|
17 | |||
17 | // TODO: We don't need to have QChart tied to QGraphicsItem: |
|
18 | // TODO: We don't need to have QChart tied to QGraphicsItem: | |
18 | //class QTCOMMERCIALCHART_EXPORT QChart |
|
19 | //class QTCOMMERCIALCHART_EXPORT QChart | |
19 | //class QTCOMMERCIALCHART_EXPORT QChartGraphicsItem : public QGraphicsItem { |
|
20 | //class QTCOMMERCIALCHART_EXPORT QChartGraphicsItem : public QGraphicsItem { | |
20 | // public: QChartGraphicsItem(QChart &chart); |
|
21 | // public: QChartGraphicsItem(QChart &chart); | |
21 |
|
22 | |||
22 | /*! |
|
23 | /*! | |
23 | * TODO: define the responsibilities |
|
24 | * TODO: define the responsibilities | |
24 | */ |
|
25 | */ | |
25 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsObject |
|
26 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsObject | |
26 | { |
|
27 | { | |
27 | Q_OBJECT |
|
28 | Q_OBJECT | |
28 | public: |
|
29 | public: | |
29 | enum ChartTheme { |
|
30 | enum ChartTheme { | |
30 | ChartThemeVanilla = 0, |
|
31 | ChartThemeVanilla = 0, | |
31 | ChartThemeIcy, |
|
32 | ChartThemeIcy, | |
32 | ChartThemeGrayscale |
|
33 | ChartThemeGrayscale | |
33 | }; |
|
34 | }; | |
34 |
|
35 | |||
35 | public: |
|
36 | public: | |
36 | QChart(QGraphicsObject* parent = 0); |
|
37 | QChart(QGraphicsObject* parent = 0); | |
37 | ~QChart(); |
|
38 | ~QChart(); | |
38 |
|
39 | |||
39 | //from QGraphicsItem |
|
40 | //from QGraphicsItem | |
40 | QRectF boundingRect() const; |
|
41 | QRectF boundingRect() const; | |
41 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){}; |
|
42 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){}; | |
42 |
|
43 | |||
43 | void addSeries(QChartSeries* series); |
|
44 | void addSeries(QChartSeries* series); | |
44 | //TODO: QChartSeries* createSeries(QSeriesData *data, QChartSeries::QChartSeriesType type); |
|
45 | //TODO: QChartSeries* createSeries(QSeriesData *data, QChartSeries::QChartSeriesType type); | |
45 | // TODO: who owns the series now? maybe owned by chart and returned a reference instead... |
|
46 | // TODO: who owns the series now? maybe owned by chart and returned a reference instead... | |
46 | QChartSeries* createSeries(QChartSeries::QChartSeriesType type); |
|
47 | QChartSeries* createSeries(QChartSeries::QChartSeriesType type); | |
47 |
|
48 | |||
48 | void setSize(const QSize& size); |
|
49 | void setSize(const QSize& size); | |
49 | void setMargin(int margin); |
|
50 | void setMargin(int margin); | |
50 | int margin() const; |
|
51 | int margin() const; | |
51 | void setTheme(QChart::ChartTheme theme); |
|
52 | void setTheme(QChart::ChartTheme theme); | |
52 |
|
53 | |||
53 | void setTitle(const QString& title); |
|
54 | void setTitle(const QString& title); | |
54 | void setBackgroundColor(const QColor& color); |
|
55 | void setBackgroundColor(const QColor& color); | |
55 |
|
56 | |||
56 | void zoomInToRect(const QRect& rectangle); |
|
57 | void zoomInToRect(const QRect& rectangle); | |
57 | void zoomIn(); |
|
58 | void zoomIn(); | |
58 | void zoomOut(); |
|
59 | void zoomOut(); | |
59 |
|
60 | |||
|
61 | void setAxisX(QChartAxis* axis){}; | |||
|
62 | void setAxisY(QChartAxis* axis){}; | |||
|
63 | void setAxisY(QList<QChartAxis*> axis){}; | |||
|
64 | ||||
|
65 | ||||
60 | signals: |
|
66 | signals: | |
61 | //TODO chage to const QSize& size |
|
67 | //TODO chage to const QSize& size | |
62 | void sizeChanged(QRectF rect); |
|
68 | void sizeChanged(QRectF rect); | |
63 | void scaleChanged(qreal xscale, qreal yscale); |
|
69 | void scaleChanged(qreal xscale, qreal yscale); | |
64 |
|
70 | |||
65 | private: |
|
71 | private: | |
66 | Q_DISABLE_COPY(QChart) |
|
72 | Q_DISABLE_COPY(QChart) | |
67 | QGraphicsRectItem* m_background; |
|
73 | QGraphicsRectItem* m_background; | |
68 | QLinearGradient m_backgroundGradient; |
|
74 | QLinearGradient m_backgroundGradient; | |
69 | QGraphicsTextItem* m_title; |
|
75 | QGraphicsTextItem* m_title; | |
70 | AxisItem* m_axisX; |
|
76 | AxisItem* m_axisX; | |
71 | AxisItem* m_axisY; |
|
77 | AxisItem* m_axisY; | |
72 | QRect m_rect; |
|
78 | QRect m_rect; | |
73 | QList<const QChartSeries*> m_series; |
|
79 | QList<const QChartSeries*> m_series; | |
74 | QVector<PlotDomain> m_plotDomainList; |
|
80 | QVector<PlotDomain> m_plotDomainList; | |
75 | QList<ChartItem*> m_chartItems; |
|
81 | QList<ChartItem*> m_chartItems; | |
76 | //TODO: remove |
|
82 | //TODO: remove | |
77 | QList<QGraphicsItem*> m_items; |
|
83 | QList<QGraphicsItem*> m_items; | |
78 | int m_plotDataIndex; |
|
84 | int m_plotDataIndex; | |
79 | int m_marginSize; |
|
85 | int m_marginSize; | |
80 | QList<QColor> m_themeColors; |
|
86 | QList<QColor> m_themeColors; | |
81 | QList<BarGroup*> m_BarGroupItems; |
|
87 | QList<BarGroup*> m_BarGroupItems; | |
82 | }; |
|
88 | }; | |
83 |
|
89 | |||
84 | QTCOMMERCIALCHART_END_NAMESPACE |
|
90 | QTCOMMERCIALCHART_END_NAMESPACE | |
85 |
|
91 | |||
86 | #endif |
|
92 | #endif |
@@ -1,89 +1,91 | |||||
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 |
|
30 | |||
30 | PRIVATE_HEADERS += \ |
|
31 | PRIVATE_HEADERS += \ | |
31 | xylinechart/xylinechartitem_p.h \ |
|
32 | xylinechart/xylinechartitem_p.h \ | |
32 | plotdomain_p.h \ |
|
33 | plotdomain_p.h \ | |
33 | qscatterseries_p.h \ |
|
34 | qscatterseries_p.h \ | |
34 | pieslice.h \ |
|
35 | pieslice.h \ | |
35 | axisitem_p.h \ |
|
36 | axisitem_p.h \ | |
36 | chartitem_p.h |
|
37 | chartitem_p.h | |
37 |
|
38 | |||
38 | PUBLIC_HEADERS += \ |
|
39 | PUBLIC_HEADERS += \ | |
39 | qchartseries.h \ |
|
40 | qchartseries.h \ | |
40 | qscatterseries.h \ |
|
41 | qscatterseries.h \ | |
41 | qpieseries.h \ |
|
42 | qpieseries.h \ | |
42 | qchart.h \ |
|
43 | qchart.h \ | |
43 | qchartwidget.h \ |
|
44 | qchartwidget.h \ | |
44 | qchartglobal.h \ |
|
45 | qchartglobal.h \ | |
45 | xylinechart/qxychartseries.h \ |
|
46 | xylinechart/qxychartseries.h \ | |
46 | barchart/barchartseries.h \ |
|
47 | barchart/barchartseries.h \ | |
47 | barchart/bargroup.h \ |
|
48 | barchart/bargroup.h \ | |
48 | qchartview.h |
|
49 | qchartview.h \ | |
|
50 | qchartaxis.h | |||
49 |
|
51 | |||
50 | HEADERS += $$PUBLIC_HEADERS |
|
52 | HEADERS += $$PUBLIC_HEADERS | |
51 | HEADERS += $$PRIVATE_HEADERS |
|
53 | HEADERS += $$PRIVATE_HEADERS | |
52 |
|
54 | |||
53 | INCLUDEPATH += xylinechart \ |
|
55 | INCLUDEPATH += xylinechart \ | |
54 | barchart \ |
|
56 | barchart \ | |
55 | . |
|
57 | . | |
56 |
|
58 | |||
57 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
59 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib | |
58 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
60 | MOC_DIR = $$CHART_BUILD_DIR/lib | |
59 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
61 | UI_DIR = $$CHART_BUILD_DIR/lib | |
60 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
62 | RCC_DIR = $$CHART_BUILD_DIR/lib | |
61 |
|
63 | |||
62 |
|
64 | |||
63 | DEFINES += QTCOMMERCIALCHART_LIBRARY |
|
65 | DEFINES += QTCOMMERCIALCHART_LIBRARY | |
64 |
|
66 | |||
65 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
67 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart | |
66 | public_headers.files = $$PUBLIC_HEADERS |
|
68 | public_headers.files = $$PUBLIC_HEADERS | |
67 | target.path = $$[QT_INSTALL_LIBS] |
|
69 | target.path = $$[QT_INSTALL_LIBS] | |
68 | INSTALLS += target \ |
|
70 | INSTALLS += target \ | |
69 | public_headers |
|
71 | public_headers | |
70 |
|
72 | |||
71 |
|
73 | |||
72 | install_build_headers.name = bild_headers |
|
74 | install_build_headers.name = bild_headers | |
73 | install_build_headers.output = $$CHART_BUILD_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
75 | install_build_headers.output = $$CHART_BUILD_HEADER_DIR/${QMAKE_FILE_BASE}.h | |
74 | install_build_headers.input = PUBLIC_HEADERS |
|
76 | install_build_headers.input = PUBLIC_HEADERS | |
75 | install_build_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} $$CHART_BUILD_HEADER_DIR |
|
77 | install_build_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} $$CHART_BUILD_HEADER_DIR | |
76 | install_build_headers.CONFIG += target_predeps no_link |
|
78 | install_build_headers.CONFIG += target_predeps no_link | |
77 | QMAKE_EXTRA_COMPILERS += install_build_headers |
|
79 | QMAKE_EXTRA_COMPILERS += install_build_headers | |
78 |
|
80 | |||
79 | chartversion.target = qchartversion_p.h |
|
81 | chartversion.target = qchartversion_p.h | |
80 | chartversion.commands = @echo "build_time" > $$chartversion.target; |
|
82 | chartversion.commands = @echo "build_time" > $$chartversion.target; | |
81 | chartversion.depends = $$HEADERS $$SOURCES |
|
83 | chartversion.depends = $$HEADERS $$SOURCES | |
82 | PRE_TARGETDEPS += qchartversion_p.h |
|
84 | PRE_TARGETDEPS += qchartversion_p.h | |
83 | QMAKE_CLEAN+= qchartversion_p.h |
|
85 | QMAKE_CLEAN+= qchartversion_p.h | |
84 | QMAKE_EXTRA_TARGETS += chartversion |
|
86 | QMAKE_EXTRA_TARGETS += chartversion | |
85 |
|
87 | |||
86 | unix:QMAKE_DISTCLEAN += -r $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR |
|
88 | unix:QMAKE_DISTCLEAN += -r $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR | |
87 | win32:QMAKE_DISTCLEAN += /Q $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR |
|
89 | win32:QMAKE_DISTCLEAN += /Q $$CHART_BUILD_HEADER_DIR $$CHART_BUILD_LIB_DIR | |
88 |
|
90 | |||
89 |
|
91 |
General Comments 0
You need to be logged in to leave comments.
Login now