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