@@ -1,48 +1,49 | |||||
1 | !include(config.pri) { |
|
1 | !include(config.pri) { | |
2 | error('Missing config.pri') |
|
2 | error('Missing config.pri') | |
3 | } |
|
3 | } | |
4 |
|
4 | |||
5 | TEMPLATE = subdirs |
|
5 | TEMPLATE = subdirs | |
6 |
SUBDIRS = src plugins |
|
6 | SUBDIRS = src plugins | |
|
7 | #examples demos tests | |||
7 |
|
8 | |||
8 | development_build: message('Development build') |
|
9 | development_build: message('Development build') | |
9 |
|
10 | |||
10 | CONFIG += ordered |
|
11 | CONFIG += ordered | |
11 | QMAKE_CXXFLAGS += -g -Wall |
|
12 | QMAKE_CXXFLAGS += -g -Wall | |
12 | unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html |
|
13 | unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html | |
13 | win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html |
|
14 | win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html | |
14 |
|
15 | |||
15 | # install feature file |
|
16 | # install feature file | |
16 | feature.path = $$[QT_INSTALL_DATA]/mkspecs/features |
|
17 | feature.path = $$[QT_INSTALL_DATA]/mkspecs/features | |
17 | feature.files = $$PWD/features/qtcommercialchart.prf |
|
18 | feature.files = $$PWD/features/qtcommercialchart.prf | |
18 | INSTALLS += feature |
|
19 | INSTALLS += feature | |
19 |
|
20 | |||
20 | docs.target = docs |
|
21 | docs.target = docs | |
21 | win32:{ |
|
22 | win32:{ | |
22 | docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR\\qcharts.qdocconf |
|
23 | docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR\\qcharts.qdocconf | |
23 | }else{ |
|
24 | }else{ | |
24 | docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR/qcharts.qdocconf |
|
25 | docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR/qcharts.qdocconf | |
25 | } |
|
26 | } | |
26 | docs.depends = FORCE |
|
27 | docs.depends = FORCE | |
27 | QMAKE_EXTRA_TARGETS += docs |
|
28 | QMAKE_EXTRA_TARGETS += docs | |
28 |
|
29 | |||
29 | unix:coverage:{ |
|
30 | unix:coverage:{ | |
30 | QMAKE_DISTCLEAN += -r ./coverage |
|
31 | QMAKE_DISTCLEAN += -r ./coverage | |
31 | QMAKE_CLEAN += build/*.gcda build/*.gcno |
|
32 | QMAKE_CLEAN += build/*.gcda build/*.gcno | |
32 | QMAKE_EXTRA_TARGETS += buildcoverage runcoverage gencoverage |
|
33 | QMAKE_EXTRA_TARGETS += buildcoverage runcoverage gencoverage | |
33 |
|
34 | |||
34 | buildcoverage.target = build_coverage |
|
35 | buildcoverage.target = build_coverage | |
35 | buildcoverage.depends = all |
|
36 | buildcoverage.depends = all | |
36 | buildcoverage.commands = mkdir -p ./coverage; \ |
|
37 | buildcoverage.commands = mkdir -p ./coverage; \ | |
37 | make -C src prepare_coverage; |
|
38 | make -C src prepare_coverage; | |
38 |
|
39 | |||
39 | runcoverage.target = run_coverage |
|
40 | runcoverage.target = run_coverage | |
40 | runcoverage.depends = buildcoverage |
|
41 | runcoverage.depends = buildcoverage | |
41 | runcoverage.commands = for f in `ls ./bin/tst_*` ; do echo "processing \$\$f test..."; \$\$f >> unit.log; done ; exit 0; |
|
42 | runcoverage.commands = for f in `ls ./bin/tst_*` ; do echo "processing \$\$f test..."; \$\$f >> unit.log; done ; exit 0; | |
42 |
|
43 | |||
43 | gencoverage.target = gen_coverage |
|
44 | gencoverage.target = gen_coverage | |
44 | gencoverage.depends = runcoverage |
|
45 | gencoverage.depends = runcoverage | |
45 | gencoverage.commands = make -C src gen_coverage; \ |
|
46 | gencoverage.commands = make -C src gen_coverage; \ | |
46 | genhtml -o ./coverage ./coverage/coverage.info --prefix $$PWD |
|
47 | genhtml -o ./coverage ./coverage/coverage.info --prefix $$PWD | |
47 | } |
|
48 | } | |
48 |
|
49 |
@@ -1,118 +1,120 | |||||
1 | ##################### LIB ################################################# |
|
1 | ##################### LIB ################################################# | |
2 |
|
2 | |||
3 | LIBRARY_NAME = QtCommercialChart |
|
3 | LIBRARY_NAME = QtCommercialChart | |
4 | CONFIG(debug, debug|release) { |
|
4 | CONFIG(debug, debug|release) { | |
5 | mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug) |
|
5 | mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug) | |
6 | win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d) |
|
6 | win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d) | |
7 | } |
|
7 | } | |
8 |
|
8 | |||
9 | LIBS += -l$$LIBRARY_NAME |
|
9 | LIBS += -l$$LIBRARY_NAME | |
10 |
|
10 | |||
11 | # This will undefine Q_DECL_EXPORT/Q_DECL_IMPORT at qchartglobal.h |
|
11 | # This will undefine Q_DECL_EXPORT/Q_DECL_IMPORT at qchartglobal.h | |
12 | # They should not be used for staticlib builds. |
|
12 | # They should not be used for staticlib builds. | |
13 | staticlib:DEFINES+=QTCOMMERCIALCHART_STATICLIB |
|
13 | staticlib:DEFINES+=QTCOMMERCIALCHART_STATICLIB | |
14 |
|
14 | |||
15 | #################### COVERAGE ################################################################# |
|
15 | #################### COVERAGE ################################################################# | |
16 | coverage: CONFIG += debug |
|
16 | coverage: CONFIG += debug | |
17 |
|
17 | |||
18 | ##################### SHADOW CONFIG ################################################# |
|
18 | ##################### SHADOW CONFIG ################################################# | |
19 |
|
19 | |||
20 | !contains($${PWD}, $${OUT_PWD}){ |
|
20 | !contains($${PWD}, $${OUT_PWD}){ | |
21 | search = "$$PWD:::" |
|
21 | search = "$$PWD:::" | |
22 | temp = $$split(search,"/") |
|
22 | temp = $$split(search,"/") | |
23 | temp = $$last(temp) |
|
23 | temp = $$last(temp) | |
24 | path = $$replace(search,$$temp,'') |
|
24 | path = $$replace(search,$$temp,'') | |
25 | temp = $$split(OUT_PWD,$$path) |
|
25 | temp = $$split(OUT_PWD,$$path) | |
26 | temp = $$split(temp,'/') |
|
26 | temp = $$split(temp,'/') | |
27 | temp = $$first(temp) |
|
27 | temp = $$first(temp) | |
28 | path = "$${path}$${temp}" |
|
28 | path = "$${path}$${temp}" | |
29 | SHADOW=$$path |
|
29 | SHADOW=$$path | |
30 | }else{ |
|
30 | }else{ | |
31 | SHADOW=$$PWD |
|
31 | SHADOW=$$PWD | |
32 | CONFIG-=development_build |
|
32 | CONFIG-=development_build | |
33 | } |
|
33 | } | |
34 |
|
34 | |||
35 | ##################### BUILD PATHS ################################################## |
|
35 | ##################### BUILD PATHS ################################################## | |
36 |
|
36 | |||
37 | CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include |
|
37 | CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include | |
38 | CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private |
|
38 | CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private | |
39 | CHART_BUILD_LIB_DIR = $$SHADOW/lib |
|
39 | CHART_BUILD_LIB_DIR = $$SHADOW/lib | |
40 | CHART_BUILD_DIR = $$SHADOW/build |
|
40 | CHART_BUILD_DIR = $$SHADOW/build | |
41 | CHART_BUILD_BIN_DIR = $$SHADOW/bin |
|
41 | CHART_BUILD_BIN_DIR = $$SHADOW/bin | |
42 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR |
|
42 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR | |
43 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR |
|
43 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR | |
44 | CHART_BUILD_DOC_DIR = $$SHADOW/doc |
|
44 | CHART_BUILD_DOC_DIR = $$SHADOW/doc | |
45 |
|
45 | |||
46 | CONFIG(release,debug|release){ |
|
46 | CONFIG(release,debug|release){ | |
47 | CHART_BUILD_LIB_DIR = $$CHART_BUILD_LIB_DIR/release |
|
47 | CHART_BUILD_LIB_DIR = $$CHART_BUILD_LIB_DIR/release | |
48 | CHART_BUILD_BIN_DIR = $$CHART_BUILD_BIN_DIR/release |
|
48 | CHART_BUILD_BIN_DIR = $$CHART_BUILD_BIN_DIR/release | |
49 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_QML_PLUGIN_DIR/release/QtCommercial/Chart |
|
49 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_QML_PLUGIN_DIR/release/QtCommercial/Chart | |
50 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR |
|
50 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | CONFIG(debug,debug|release){ |
|
54 | CONFIG(debug,debug|release){ | |
55 | CHART_BUILD_LIB_DIR = $$CHART_BUILD_LIB_DIR/debug |
|
55 | CHART_BUILD_LIB_DIR = $$CHART_BUILD_LIB_DIR/debug | |
56 | CHART_BUILD_BIN_DIR = $$CHART_BUILD_BIN_DIR/debug |
|
56 | CHART_BUILD_BIN_DIR = $$CHART_BUILD_BIN_DIR/debug | |
57 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_QML_PLUGIN_DIR/debug/QtCommercial/Chart |
|
57 | CHART_BUILD_QML_PLUGIN_DIR = $$CHART_BUILD_QML_PLUGIN_DIR/debug/QtCommercial/Chart | |
58 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR |
|
58 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR | |
59 | } |
|
59 | } | |
60 | # Use own folders for debug and release builds |
|
60 | # Use own folders for debug and release builds | |
61 |
|
61 | |||
62 | CONFIG(debug, debug|release):CHART_BUILD_DIR = $$join(CHART_BUILD_DIR,,,/debug) |
|
62 | CONFIG(debug, debug|release):CHART_BUILD_DIR = $$join(CHART_BUILD_DIR,,,/debug) | |
63 | CONFIG(release, debug|release): CHART_BUILD_DIR = $$join(CHART_BUILD_DIR,,,/release) |
|
63 | CONFIG(release, debug|release): CHART_BUILD_DIR = $$join(CHART_BUILD_DIR,,,/release) | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | win32:{ |
|
66 | win32:{ | |
67 | CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\") |
|
67 | CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\") | |
68 | CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\") |
|
68 | CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\") | |
69 | CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\") |
|
69 | CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\") | |
70 | CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\") |
|
70 | CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\") | |
71 | CHART_BUILD_QML_PLUGIN_DIR = $$replace(CHART_BUILD_QML_PLUGIN_DIR, "/","\\") |
|
71 | CHART_BUILD_QML_PLUGIN_DIR = $$replace(CHART_BUILD_QML_PLUGIN_DIR, "/","\\") | |
72 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$replace(CHART_BUILD_DESIGNER_PLUGIN_DIR, "/","\\") |
|
72 | CHART_BUILD_DESIGNER_PLUGIN_DIR = $$replace(CHART_BUILD_DESIGNER_PLUGIN_DIR, "/","\\") | |
73 | CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\") |
|
73 | CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\") | |
74 | CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\") |
|
74 | CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\") | |
75 | } |
|
75 | } | |
76 |
|
76 | |||
77 | mac: { |
|
77 | mac: { | |
78 | # Some Qt versions use an incompatible configuration on OSX which makes the build fail. |
|
78 | # Some Qt versions use an incompatible configuration on OSX which makes the build fail. | |
79 | # As a work-around, set the minimum OSX version to 10.5. |
|
79 | # As a work-around, set the minimum OSX version to 10.5. | |
80 | QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5 |
|
80 | QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5 | |
81 | QMAKE_LFLAGS *= -mmacosx-version-min=10.5 |
|
81 | QMAKE_LFLAGS *= -mmacosx-version-min=10.5 | |
82 | } |
|
82 | } | |
83 |
|
83 | |||
84 | linux-arm*: { |
|
84 | linux-arm*: { | |
85 | DEFINES+=QT_ON_ARM |
|
85 | DEFINES+=QT_ON_ARM | |
86 | } |
|
86 | } | |
87 |
|
87 | |||
|
88 | greaterThan(QT_MAJOR_VERSION, 4): DEFINES += QT5_QUICK_1 | |||
|
89 | ||||
88 | ##################### INCLUDES ############################################################ |
|
90 | ##################### INCLUDES ############################################################ | |
89 |
|
91 | |||
90 |
|
92 | |||
91 | INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
93 | INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR | |
92 |
|
94 | |||
93 | !win32: { |
|
95 | !win32: { | |
94 | LIBS += -L$$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR |
|
96 | LIBS += -L$$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR | |
95 | } else { |
|
97 | } else { | |
96 | win32-msvc*: { |
|
98 | win32-msvc*: { | |
97 | # hack fix for error: |
|
99 | # hack fix for error: | |
98 | # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'" |
|
100 | # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'" | |
99 | QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR |
|
101 | QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR | |
100 | } else { |
|
102 | } else { | |
101 | LIBS += -L$$CHART_BUILD_LIB_DIR |
|
103 | LIBS += -L$$CHART_BUILD_LIB_DIR | |
102 | } |
|
104 | } | |
103 | } |
|
105 | } | |
104 |
|
106 | |||
105 | ##################### DEVELOPMENT BUILD ################################################### |
|
107 | ##################### DEVELOPMENT BUILD ################################################### | |
106 |
|
108 | |||
107 | development_build: { |
|
109 | development_build: { | |
108 | DEFINES+=DEVELOPMENT_BUILD |
|
110 | DEFINES+=DEVELOPMENT_BUILD | |
109 | CONFIG+=debug_and_release |
|
111 | CONFIG+=debug_and_release | |
110 | CONFIG+=build_all |
|
112 | CONFIG+=build_all | |
111 | } |
|
113 | } | |
112 |
|
114 | |||
113 | ##################### UNIT TESTS ############################################################## |
|
115 | ##################### UNIT TESTS ############################################################## | |
114 |
|
116 | |||
115 | CONFIG(debug, debug|release) { |
|
117 | CONFIG(debug, debug|release) { | |
116 | DEFINES+=BUILD_PRIVATE_UNIT_TESTS |
|
118 | DEFINES+=BUILD_PRIVATE_UNIT_TESTS | |
117 | } |
|
119 | } | |
118 |
|
120 |
@@ -1,308 +1,313 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEBARSERIES_H |
|
21 | #ifndef DECLARATIVEBARSERIES_H | |
22 | #define DECLARATIVEBARSERIES_H |
|
22 | #define DECLARATIVEBARSERIES_H | |
23 |
|
23 | |||
24 | #include "qbarseries.h" |
|
24 | #include "qbarseries.h" | |
25 | #include "qstackedbarseries.h" |
|
25 | #include "qstackedbarseries.h" | |
26 | #include "qpercentbarseries.h" |
|
26 | #include "qpercentbarseries.h" | |
27 | #include "qhorizontalbarseries.h" |
|
27 | #include "qhorizontalbarseries.h" | |
28 | #include "qhorizontalstackedbarseries.h" |
|
28 | #include "qhorizontalstackedbarseries.h" | |
29 | #include "qhorizontalpercentbarseries.h" |
|
29 | #include "qhorizontalpercentbarseries.h" | |
30 | #include "qbarset.h" |
|
30 | #include "qbarset.h" | |
31 | #include <QDeclarativeItem> |
|
31 | #ifdef QT5_QUICK_1 | |
32 |
#include <QDeclarative |
|
32 | #include <QtQuick1/QDeclarativeItem> | |
|
33 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
34 | #else | |||
|
35 | #include <QtDeclarative/QDeclarativeItem> | |||
|
36 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
37 | #endif | |||
33 |
|
38 | |||
34 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
39 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
35 |
|
40 | |||
36 | class QChart; |
|
41 | class QChart; | |
37 |
|
42 | |||
38 | class DeclarativeBarSet : public QBarSet |
|
43 | class DeclarativeBarSet : public QBarSet | |
39 | { |
|
44 | { | |
40 | Q_OBJECT |
|
45 | Q_OBJECT | |
41 | Q_PROPERTY(QVariantList values READ values WRITE setValues) |
|
46 | Q_PROPERTY(QVariantList values READ values WRITE setValues) | |
42 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
47 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
43 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
48 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
44 |
|
49 | |||
45 | public: |
|
50 | public: | |
46 | explicit DeclarativeBarSet(QObject *parent = 0); |
|
51 | explicit DeclarativeBarSet(QObject *parent = 0); | |
47 | QVariantList values(); |
|
52 | QVariantList values(); | |
48 | void setValues(QVariantList values); |
|
53 | void setValues(QVariantList values); | |
49 | qreal borderWidth() const; |
|
54 | qreal borderWidth() const; | |
50 | void setBorderWidth(qreal borderWidth); |
|
55 | void setBorderWidth(qreal borderWidth); | |
51 |
|
56 | |||
52 | public: // From QBarSet |
|
57 | public: // From QBarSet | |
53 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } |
|
58 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } | |
54 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } |
|
59 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } | |
55 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } |
|
60 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } | |
56 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } |
|
61 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } | |
57 |
|
62 | |||
58 | Q_SIGNALS: |
|
63 | Q_SIGNALS: | |
59 | void countChanged(int count); |
|
64 | void countChanged(int count); | |
60 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
65 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
61 |
|
66 | |||
62 | private Q_SLOTS: |
|
67 | private Q_SLOTS: | |
63 | void handleCountChanged(int index, int count); |
|
68 | void handleCountChanged(int index, int count); | |
64 | }; |
|
69 | }; | |
65 |
|
70 | |||
66 | class DeclarativeBarSeries : public QBarSeries, public QDeclarativeParserStatus |
|
71 | class DeclarativeBarSeries : public QBarSeries, public QDeclarativeParserStatus | |
67 | { |
|
72 | { | |
68 | Q_OBJECT |
|
73 | Q_OBJECT | |
69 | Q_INTERFACES(QDeclarativeParserStatus) |
|
74 | Q_INTERFACES(QDeclarativeParserStatus) | |
70 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
75 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
71 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
76 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
72 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
77 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
73 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
78 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
74 |
|
79 | |||
75 | public: |
|
80 | public: | |
76 | explicit DeclarativeBarSeries(QDeclarativeItem *parent = 0); |
|
81 | explicit DeclarativeBarSeries(QDeclarativeItem *parent = 0); | |
77 | QAbstractAxis *axisX() { return m_axisX; } |
|
82 | QAbstractAxis *axisX() { return m_axisX; } | |
78 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
83 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
79 | QAbstractAxis *axisY() { return m_axisY; } |
|
84 | QAbstractAxis *axisY() { return m_axisY; } | |
80 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
85 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
81 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
86 | QDeclarativeListProperty<QObject> seriesChildren(); | |
82 |
|
87 | |||
83 | public: |
|
88 | public: | |
84 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
89 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
85 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
90 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
86 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
91 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
87 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } |
|
92 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } | |
88 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } |
|
93 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } | |
89 |
|
94 | |||
90 | public: // from QDeclarativeParserStatus |
|
95 | public: // from QDeclarativeParserStatus | |
91 | void classBegin(); |
|
96 | void classBegin(); | |
92 | void componentComplete(); |
|
97 | void componentComplete(); | |
93 |
|
98 | |||
94 | Q_SIGNALS: |
|
99 | Q_SIGNALS: | |
95 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
100 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
96 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
101 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
97 |
|
102 | |||
98 | public Q_SLOTS: |
|
103 | public Q_SLOTS: | |
99 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
104 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
100 |
|
105 | |||
101 | private: |
|
106 | private: | |
102 | QAbstractAxis* m_axisX; |
|
107 | QAbstractAxis* m_axisX; | |
103 | QAbstractAxis* m_axisY; |
|
108 | QAbstractAxis* m_axisY; | |
104 | }; |
|
109 | }; | |
105 |
|
110 | |||
106 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDeclarativeParserStatus |
|
111 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDeclarativeParserStatus | |
107 | { |
|
112 | { | |
108 | Q_OBJECT |
|
113 | Q_OBJECT | |
109 | Q_INTERFACES(QDeclarativeParserStatus) |
|
114 | Q_INTERFACES(QDeclarativeParserStatus) | |
110 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
115 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
111 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
116 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
112 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
117 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
113 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
118 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
114 |
|
119 | |||
115 | public: |
|
120 | public: | |
116 | explicit DeclarativeStackedBarSeries(QDeclarativeItem *parent = 0); |
|
121 | explicit DeclarativeStackedBarSeries(QDeclarativeItem *parent = 0); | |
117 | QAbstractAxis *axisX() { return m_axisX; } |
|
122 | QAbstractAxis *axisX() { return m_axisX; } | |
118 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
123 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
119 | QAbstractAxis *axisY() { return m_axisY; } |
|
124 | QAbstractAxis *axisY() { return m_axisY; } | |
120 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
125 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
121 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
126 | QDeclarativeListProperty<QObject> seriesChildren(); | |
122 |
|
127 | |||
123 | public: |
|
128 | public: | |
124 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
129 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
125 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
130 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
126 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
131 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
127 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } |
|
132 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } | |
128 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } |
|
133 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } | |
129 |
|
134 | |||
130 | public: // from QDeclarativeParserStatus |
|
135 | public: // from QDeclarativeParserStatus | |
131 | void classBegin(); |
|
136 | void classBegin(); | |
132 | void componentComplete(); |
|
137 | void componentComplete(); | |
133 |
|
138 | |||
134 | Q_SIGNALS: |
|
139 | Q_SIGNALS: | |
135 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
140 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
136 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
141 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
137 |
|
142 | |||
138 | public Q_SLOTS: |
|
143 | public Q_SLOTS: | |
139 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
144 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
140 |
|
145 | |||
141 | private: |
|
146 | private: | |
142 | QAbstractAxis* m_axisX; |
|
147 | QAbstractAxis* m_axisX; | |
143 | QAbstractAxis* m_axisY; |
|
148 | QAbstractAxis* m_axisY; | |
144 | }; |
|
149 | }; | |
145 |
|
150 | |||
146 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDeclarativeParserStatus |
|
151 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDeclarativeParserStatus | |
147 | { |
|
152 | { | |
148 | Q_OBJECT |
|
153 | Q_OBJECT | |
149 | Q_INTERFACES(QDeclarativeParserStatus) |
|
154 | Q_INTERFACES(QDeclarativeParserStatus) | |
150 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
155 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
151 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
156 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
152 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
157 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
153 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
158 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
154 |
|
159 | |||
155 | public: |
|
160 | public: | |
156 | explicit DeclarativePercentBarSeries(QDeclarativeItem *parent = 0); |
|
161 | explicit DeclarativePercentBarSeries(QDeclarativeItem *parent = 0); | |
157 | QAbstractAxis *axisX() { return m_axisX; } |
|
162 | QAbstractAxis *axisX() { return m_axisX; } | |
158 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
163 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
159 | QAbstractAxis *axisY() { return m_axisY; } |
|
164 | QAbstractAxis *axisY() { return m_axisY; } | |
160 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
165 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
161 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
166 | QDeclarativeListProperty<QObject> seriesChildren(); | |
162 |
|
167 | |||
163 | public: |
|
168 | public: | |
164 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
169 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
165 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
170 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
166 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
171 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
167 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } |
|
172 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } | |
168 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } |
|
173 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } | |
169 |
|
174 | |||
170 | public: // from QDeclarativeParserStatus |
|
175 | public: // from QDeclarativeParserStatus | |
171 | void classBegin(); |
|
176 | void classBegin(); | |
172 | void componentComplete(); |
|
177 | void componentComplete(); | |
173 |
|
178 | |||
174 | Q_SIGNALS: |
|
179 | Q_SIGNALS: | |
175 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
180 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
176 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
181 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
177 |
|
182 | |||
178 | public Q_SLOTS: |
|
183 | public Q_SLOTS: | |
179 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
184 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
180 |
|
185 | |||
181 | private: |
|
186 | private: | |
182 | QAbstractAxis* m_axisX; |
|
187 | QAbstractAxis* m_axisX; | |
183 | QAbstractAxis* m_axisY; |
|
188 | QAbstractAxis* m_axisY; | |
184 | }; |
|
189 | }; | |
185 |
|
190 | |||
186 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDeclarativeParserStatus |
|
191 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDeclarativeParserStatus | |
187 | { |
|
192 | { | |
188 | Q_OBJECT |
|
193 | Q_OBJECT | |
189 | Q_INTERFACES(QDeclarativeParserStatus) |
|
194 | Q_INTERFACES(QDeclarativeParserStatus) | |
190 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
195 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
191 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
196 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
192 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
197 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
193 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
198 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
194 |
|
199 | |||
195 | public: |
|
200 | public: | |
196 | explicit DeclarativeHorizontalBarSeries(QDeclarativeItem *parent = 0); |
|
201 | explicit DeclarativeHorizontalBarSeries(QDeclarativeItem *parent = 0); | |
197 | QAbstractAxis *axisX() { return m_axisX; } |
|
202 | QAbstractAxis *axisX() { return m_axisX; } | |
198 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
203 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
199 | QAbstractAxis *axisY() { return m_axisY; } |
|
204 | QAbstractAxis *axisY() { return m_axisY; } | |
200 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
205 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
201 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
206 | QDeclarativeListProperty<QObject> seriesChildren(); | |
202 |
|
207 | |||
203 | public: |
|
208 | public: | |
204 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
209 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
205 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
210 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
206 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
211 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
207 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } |
|
212 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } | |
208 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } |
|
213 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } | |
209 |
|
214 | |||
210 | public: // from QDeclarativeParserStatus |
|
215 | public: // from QDeclarativeParserStatus | |
211 | void classBegin(); |
|
216 | void classBegin(); | |
212 | void componentComplete(); |
|
217 | void componentComplete(); | |
213 |
|
218 | |||
214 | Q_SIGNALS: |
|
219 | Q_SIGNALS: | |
215 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
220 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
216 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
221 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
217 |
|
222 | |||
218 | public Q_SLOTS: |
|
223 | public Q_SLOTS: | |
219 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
224 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
220 |
|
225 | |||
221 | private: |
|
226 | private: | |
222 | QAbstractAxis* m_axisX; |
|
227 | QAbstractAxis* m_axisX; | |
223 | QAbstractAxis* m_axisY; |
|
228 | QAbstractAxis* m_axisY; | |
224 | }; |
|
229 | }; | |
225 |
|
230 | |||
226 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDeclarativeParserStatus |
|
231 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDeclarativeParserStatus | |
227 | { |
|
232 | { | |
228 | Q_OBJECT |
|
233 | Q_OBJECT | |
229 | Q_INTERFACES(QDeclarativeParserStatus) |
|
234 | Q_INTERFACES(QDeclarativeParserStatus) | |
230 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
235 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
231 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
236 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
232 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
237 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
233 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
238 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
234 |
|
239 | |||
235 | public: |
|
240 | public: | |
236 | explicit DeclarativeHorizontalStackedBarSeries(QDeclarativeItem *parent = 0); |
|
241 | explicit DeclarativeHorizontalStackedBarSeries(QDeclarativeItem *parent = 0); | |
237 | QAbstractAxis *axisX() { return m_axisX; } |
|
242 | QAbstractAxis *axisX() { return m_axisX; } | |
238 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
243 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
239 | QAbstractAxis *axisY() { return m_axisY; } |
|
244 | QAbstractAxis *axisY() { return m_axisY; } | |
240 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
245 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
241 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
246 | QDeclarativeListProperty<QObject> seriesChildren(); | |
242 |
|
247 | |||
243 | public: |
|
248 | public: | |
244 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
249 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
245 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
250 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
246 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
251 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
247 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } |
|
252 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } | |
248 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } |
|
253 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } | |
249 |
|
254 | |||
250 | public: // from QDeclarativeParserStatus |
|
255 | public: // from QDeclarativeParserStatus | |
251 | void classBegin(); |
|
256 | void classBegin(); | |
252 | void componentComplete(); |
|
257 | void componentComplete(); | |
253 |
|
258 | |||
254 | Q_SIGNALS: |
|
259 | Q_SIGNALS: | |
255 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
260 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
256 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
261 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
257 |
|
262 | |||
258 | public Q_SLOTS: |
|
263 | public Q_SLOTS: | |
259 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
264 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
260 |
|
265 | |||
261 | private: |
|
266 | private: | |
262 | QAbstractAxis* m_axisX; |
|
267 | QAbstractAxis* m_axisX; | |
263 | QAbstractAxis* m_axisY; |
|
268 | QAbstractAxis* m_axisY; | |
264 | }; |
|
269 | }; | |
265 |
|
270 | |||
266 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDeclarativeParserStatus |
|
271 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDeclarativeParserStatus | |
267 | { |
|
272 | { | |
268 | Q_OBJECT |
|
273 | Q_OBJECT | |
269 | Q_INTERFACES(QDeclarativeParserStatus) |
|
274 | Q_INTERFACES(QDeclarativeParserStatus) | |
270 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
275 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
271 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
276 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
272 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
277 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
273 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
278 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
274 |
|
279 | |||
275 | public: |
|
280 | public: | |
276 | explicit DeclarativeHorizontalPercentBarSeries(QDeclarativeItem *parent = 0); |
|
281 | explicit DeclarativeHorizontalPercentBarSeries(QDeclarativeItem *parent = 0); | |
277 | QAbstractAxis *axisX() { return m_axisX; } |
|
282 | QAbstractAxis *axisX() { return m_axisX; } | |
278 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
283 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
279 | QAbstractAxis *axisY() { return m_axisY; } |
|
284 | QAbstractAxis *axisY() { return m_axisY; } | |
280 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
285 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
281 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
286 | QDeclarativeListProperty<QObject> seriesChildren(); | |
282 |
|
287 | |||
283 | public: |
|
288 | public: | |
284 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
289 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
285 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
290 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
286 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
291 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
287 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } |
|
292 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } | |
288 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } |
|
293 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } | |
289 |
|
294 | |||
290 | public: // from QDeclarativeParserStatus |
|
295 | public: // from QDeclarativeParserStatus | |
291 | void classBegin(); |
|
296 | void classBegin(); | |
292 | void componentComplete(); |
|
297 | void componentComplete(); | |
293 |
|
298 | |||
294 | Q_SIGNALS: |
|
299 | Q_SIGNALS: | |
295 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
300 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
296 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
301 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
297 |
|
302 | |||
298 | public Q_SLOTS: |
|
303 | public Q_SLOTS: | |
299 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
304 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
300 |
|
305 | |||
301 | private: |
|
306 | private: | |
302 | QAbstractAxis* m_axisX; |
|
307 | QAbstractAxis* m_axisX; | |
303 | QAbstractAxis* m_axisY; |
|
308 | QAbstractAxis* m_axisY; | |
304 | }; |
|
309 | }; | |
305 |
|
310 | |||
306 | QTCOMMERCIALCHART_END_NAMESPACE |
|
311 | QTCOMMERCIALCHART_END_NAMESPACE | |
307 |
|
312 | |||
308 | #endif // DECLARATIVEBARSERIES_H |
|
313 | #endif // DECLARATIVEBARSERIES_H |
@@ -1,72 +1,77 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVECATEGORYAXIS_H |
|
21 | #ifndef DECLARATIVECATEGORYAXIS_H | |
22 | #define DECLARATIVECATEGORYAXIS_H |
|
22 | #define DECLARATIVECATEGORYAXIS_H | |
23 |
|
23 | |||
24 | #include "qcategoryaxis.h" |
|
24 | #include "qcategoryaxis.h" | |
25 | #include <QDeclarativeParserStatus> |
|
25 | #ifdef QT5_QUICK_1 | |
26 | #include <QDeclarativeListProperty> |
|
26 | #include <QtQuick1/QDeclarativeListProperty> | |
|
27 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
28 | #else | |||
|
29 | #include <QtDeclarative/QDeclarativeListProperty> | |||
|
30 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
31 | #endif | |||
27 |
|
32 | |||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
33 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
29 |
|
34 | |||
30 | class DeclarativeCategoryRange : public QObject |
|
35 | class DeclarativeCategoryRange : public QObject | |
31 | { |
|
36 | { | |
32 | Q_OBJECT |
|
37 | Q_OBJECT | |
33 | Q_PROPERTY(qreal endValue READ endValue WRITE setEndValue) |
|
38 | Q_PROPERTY(qreal endValue READ endValue WRITE setEndValue) | |
34 | Q_PROPERTY(QString label READ label WRITE setLabel) |
|
39 | Q_PROPERTY(QString label READ label WRITE setLabel) | |
35 |
|
40 | |||
36 | public: |
|
41 | public: | |
37 | explicit DeclarativeCategoryRange(QObject *parent = 0); |
|
42 | explicit DeclarativeCategoryRange(QObject *parent = 0); | |
38 | qreal endValue() { return m_endValue; } |
|
43 | qreal endValue() { return m_endValue; } | |
39 | void setEndValue(qreal endValue) { m_endValue = endValue; } |
|
44 | void setEndValue(qreal endValue) { m_endValue = endValue; } | |
40 | QString label() { return m_label; } |
|
45 | QString label() { return m_label; } | |
41 | void setLabel(QString label) { m_label = label; } |
|
46 | void setLabel(QString label) { m_label = label; } | |
42 |
|
47 | |||
43 | private: |
|
48 | private: | |
44 | qreal m_endValue; |
|
49 | qreal m_endValue; | |
45 | QString m_label; |
|
50 | QString m_label; | |
46 | }; |
|
51 | }; | |
47 |
|
52 | |||
48 | class DeclarativeCategoryAxis : public QCategoryAxis, public QDeclarativeParserStatus |
|
53 | class DeclarativeCategoryAxis : public QCategoryAxis, public QDeclarativeParserStatus | |
49 | { |
|
54 | { | |
50 | Q_OBJECT |
|
55 | Q_OBJECT | |
51 | Q_INTERFACES(QDeclarativeParserStatus) |
|
56 | Q_INTERFACES(QDeclarativeParserStatus) | |
52 | Q_PROPERTY(QDeclarativeListProperty<QObject> axisChildren READ axisChildren) |
|
57 | Q_PROPERTY(QDeclarativeListProperty<QObject> axisChildren READ axisChildren) | |
53 | Q_CLASSINFO("DefaultProperty", "axisChildren") |
|
58 | Q_CLASSINFO("DefaultProperty", "axisChildren") | |
54 |
|
59 | |||
55 | public: |
|
60 | public: | |
56 | explicit DeclarativeCategoryAxis(QObject *parent = 0); |
|
61 | explicit DeclarativeCategoryAxis(QObject *parent = 0); | |
57 | QDeclarativeListProperty<QObject> axisChildren(); |
|
62 | QDeclarativeListProperty<QObject> axisChildren(); | |
58 |
|
63 | |||
59 | public: // from QDeclarativeParserStatus |
|
64 | public: // from QDeclarativeParserStatus | |
60 | void classBegin(); |
|
65 | void classBegin(); | |
61 | void componentComplete(); |
|
66 | void componentComplete(); | |
62 |
|
67 | |||
63 | public Q_SLOTS: |
|
68 | public Q_SLOTS: | |
64 | Q_INVOKABLE void append(const QString &label, qreal categoryEndValue); |
|
69 | Q_INVOKABLE void append(const QString &label, qreal categoryEndValue); | |
65 | Q_INVOKABLE void remove(const QString &label); |
|
70 | Q_INVOKABLE void remove(const QString &label); | |
66 | Q_INVOKABLE void replace(const QString& oldLabel, const QString& newLabel); |
|
71 | Q_INVOKABLE void replace(const QString& oldLabel, const QString& newLabel); | |
67 | static void appendAxisChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
72 | static void appendAxisChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
68 | }; |
|
73 | }; | |
69 |
|
74 | |||
70 | QTCOMMERCIALCHART_END_NAMESPACE |
|
75 | QTCOMMERCIALCHART_END_NAMESPACE | |
71 |
|
76 | |||
72 | #endif // DECLARATIVECATEGORYAXIS_H |
|
77 | #endif // DECLARATIVECATEGORYAXIS_H |
@@ -1,162 +1,166 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVECHART_H |
|
21 | #ifndef DECLARATIVECHART_H | |
22 | #define DECLARATIVECHART_H |
|
22 | #define DECLARATIVECHART_H | |
23 |
|
23 | |||
24 | #include <QtCore/QtGlobal> |
|
24 | #include <QtCore/QtGlobal> | |
25 | #include <QDeclarativeItem> |
|
25 | #ifdef QT5_QUICK_1 | |
|
26 | #include <QtQuick1/QDeclarativeItem> | |||
|
27 | #else | |||
|
28 | #include <QtDeclarative/QDeclarativeItem> | |||
|
29 | #endif | |||
26 | #include "qchart.h" |
|
30 | #include "qchart.h" | |
27 |
|
31 | |||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
29 |
|
33 | |||
30 | class DeclarativeMargins; |
|
34 | class DeclarativeMargins; | |
31 |
|
35 | |||
32 | class DeclarativeChart : public QDeclarativeItem |
|
36 | class DeclarativeChart : public QDeclarativeItem | |
33 | { |
|
37 | { | |
34 | Q_OBJECT |
|
38 | Q_OBJECT | |
35 | Q_PROPERTY(Theme theme READ theme WRITE setTheme) |
|
39 | Q_PROPERTY(Theme theme READ theme WRITE setTheme) | |
36 | Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions) |
|
40 | Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions) | |
37 | Q_PROPERTY(QString title READ title WRITE setTitle) |
|
41 | Q_PROPERTY(QString title READ title WRITE setTitle) | |
38 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont) |
|
42 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont) | |
39 | Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged) |
|
43 | Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged) | |
40 | Q_PROPERTY(QLegend *legend READ legend) |
|
44 | Q_PROPERTY(QLegend *legend READ legend) | |
41 | Q_PROPERTY(int count READ count) |
|
45 | Q_PROPERTY(int count READ count) | |
42 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) |
|
46 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) | |
43 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) |
|
47 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) | |
44 | Q_PROPERTY(qreal topMargin READ topMargin) |
|
48 | Q_PROPERTY(qreal topMargin READ topMargin) | |
45 | Q_PROPERTY(qreal bottomMargin READ bottomMargin) |
|
49 | Q_PROPERTY(qreal bottomMargin READ bottomMargin) | |
46 | Q_PROPERTY(qreal leftMargin READ leftMargin) |
|
50 | Q_PROPERTY(qreal leftMargin READ leftMargin) | |
47 | Q_PROPERTY(qreal rightMargin READ rightMargin) |
|
51 | Q_PROPERTY(qreal rightMargin READ rightMargin) | |
48 | Q_PROPERTY(DeclarativeMargins *minimumMargins READ minimumMargins NOTIFY minimumMarginsChanged REVISION 1) |
|
52 | Q_PROPERTY(DeclarativeMargins *minimumMargins READ minimumMargins NOTIFY minimumMarginsChanged REVISION 1) | |
49 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) |
|
53 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) | |
50 | Q_ENUMS(Animation) |
|
54 | Q_ENUMS(Animation) | |
51 | Q_ENUMS(Theme) |
|
55 | Q_ENUMS(Theme) | |
52 | Q_ENUMS(SeriesType) |
|
56 | Q_ENUMS(SeriesType) | |
53 |
|
57 | |||
54 | public: |
|
58 | public: | |
55 | // duplicating enums from QChart to make the QML api namings 1-to-1 with the C++ api |
|
59 | // duplicating enums from QChart to make the QML api namings 1-to-1 with the C++ api | |
56 | enum Theme { |
|
60 | enum Theme { | |
57 | ChartThemeLight = 0, |
|
61 | ChartThemeLight = 0, | |
58 | ChartThemeBlueCerulean, |
|
62 | ChartThemeBlueCerulean, | |
59 | ChartThemeDark, |
|
63 | ChartThemeDark, | |
60 | ChartThemeBrownSand, |
|
64 | ChartThemeBrownSand, | |
61 | ChartThemeBlueNcs, |
|
65 | ChartThemeBlueNcs, | |
62 | ChartThemeHighContrast, |
|
66 | ChartThemeHighContrast, | |
63 | ChartThemeBlueIcy |
|
67 | ChartThemeBlueIcy | |
64 | }; |
|
68 | }; | |
65 |
|
69 | |||
66 | enum Animation { |
|
70 | enum Animation { | |
67 | NoAnimation = 0x0, |
|
71 | NoAnimation = 0x0, | |
68 | GridAxisAnimations = 0x1, |
|
72 | GridAxisAnimations = 0x1, | |
69 | SeriesAnimations =0x2, |
|
73 | SeriesAnimations =0x2, | |
70 | AllAnimations = 0x3 |
|
74 | AllAnimations = 0x3 | |
71 | }; |
|
75 | }; | |
72 |
|
76 | |||
73 | enum SeriesType { |
|
77 | enum SeriesType { | |
74 | SeriesTypeLine, |
|
78 | SeriesTypeLine, | |
75 | SeriesTypeArea, |
|
79 | SeriesTypeArea, | |
76 | SeriesTypeBar, |
|
80 | SeriesTypeBar, | |
77 | SeriesTypeStackedBar, |
|
81 | SeriesTypeStackedBar, | |
78 | SeriesTypePercentBar, |
|
82 | SeriesTypePercentBar, | |
79 | SeriesTypePie, |
|
83 | SeriesTypePie, | |
80 | SeriesTypeScatter, |
|
84 | SeriesTypeScatter, | |
81 | SeriesTypeSpline, |
|
85 | SeriesTypeSpline, | |
82 | SeriesTypeHorizontalBar, |
|
86 | SeriesTypeHorizontalBar, | |
83 | SeriesTypeHorizontalStackedBar, |
|
87 | SeriesTypeHorizontalStackedBar, | |
84 | SeriesTypeHorizontalPercentBar |
|
88 | SeriesTypeHorizontalPercentBar | |
85 | }; |
|
89 | }; | |
86 |
|
90 | |||
87 | public: |
|
91 | public: | |
88 | DeclarativeChart(QDeclarativeItem *parent = 0); |
|
92 | DeclarativeChart(QDeclarativeItem *parent = 0); | |
89 | ~DeclarativeChart(); |
|
93 | ~DeclarativeChart(); | |
90 |
|
94 | |||
91 | public: // From QDeclarativeItem/QGraphicsItem |
|
95 | public: // From QDeclarativeItem/QGraphicsItem | |
92 | void childEvent(QChildEvent *event); |
|
96 | void childEvent(QChildEvent *event); | |
93 | void componentComplete(); |
|
97 | void componentComplete(); | |
94 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); |
|
98 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); | |
95 |
|
99 | |||
96 | public: |
|
100 | public: | |
97 | void setTheme(DeclarativeChart::Theme theme); |
|
101 | void setTheme(DeclarativeChart::Theme theme); | |
98 | DeclarativeChart::Theme theme(); |
|
102 | DeclarativeChart::Theme theme(); | |
99 | void setAnimationOptions(DeclarativeChart::Animation animations); |
|
103 | void setAnimationOptions(DeclarativeChart::Animation animations); | |
100 | DeclarativeChart::Animation animationOptions(); |
|
104 | DeclarativeChart::Animation animationOptions(); | |
101 | void setTitle(QString title); |
|
105 | void setTitle(QString title); | |
102 | QString title(); |
|
106 | QString title(); | |
103 | QLegend *legend(); |
|
107 | QLegend *legend(); | |
104 | QFont titleFont() const; |
|
108 | QFont titleFont() const; | |
105 | void setTitleFont(const QFont& font); |
|
109 | void setTitleFont(const QFont& font); | |
106 | void setTitleColor(QColor color); |
|
110 | void setTitleColor(QColor color); | |
107 | QColor titleColor(); |
|
111 | QColor titleColor(); | |
108 | void setBackgroundColor(QColor color); |
|
112 | void setBackgroundColor(QColor color); | |
109 | QColor backgroundColor(); |
|
113 | QColor backgroundColor(); | |
110 | int count(); |
|
114 | int count(); | |
111 | void setDropShadowEnabled(bool enabled); |
|
115 | void setDropShadowEnabled(bool enabled); | |
112 | bool dropShadowEnabled(); |
|
116 | bool dropShadowEnabled(); | |
113 | qreal topMargin(); |
|
117 | qreal topMargin(); | |
114 | qreal bottomMargin(); |
|
118 | qreal bottomMargin(); | |
115 | qreal leftMargin(); |
|
119 | qreal leftMargin(); | |
116 | qreal rightMargin(); |
|
120 | qreal rightMargin(); | |
117 | void createDefaultAxes(QAbstractSeries* series); |
|
121 | void createDefaultAxes(QAbstractSeries* series); | |
118 | DeclarativeMargins *minimumMargins() { return m_minMargins; } |
|
122 | DeclarativeMargins *minimumMargins() { return m_minMargins; } | |
119 | QRectF plotArea() { return m_chart->plotArea(); } |
|
123 | QRectF plotArea() { return m_chart->plotArea(); } | |
120 |
|
124 | |||
121 | public: |
|
125 | public: | |
122 | Q_INVOKABLE QAbstractSeries *series(int index); |
|
126 | Q_INVOKABLE QAbstractSeries *series(int index); | |
123 | Q_INVOKABLE QAbstractSeries *series(QString seriesName); |
|
127 | Q_INVOKABLE QAbstractSeries *series(QString seriesName); | |
124 | Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name = ""); |
|
128 | Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name = ""); | |
125 | Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name, QAbstractAxis *axisX, QAbstractAxis *axisY); |
|
129 | Q_INVOKABLE QAbstractSeries *createSeries(DeclarativeChart::SeriesType type, QString name, QAbstractAxis *axisX, QAbstractAxis *axisY); | |
126 | Q_INVOKABLE void removeSeries(QAbstractSeries *series) { m_chart->removeSeries(series); } |
|
130 | Q_INVOKABLE void removeSeries(QAbstractSeries *series) { m_chart->removeSeries(series); } | |
127 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } |
|
131 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } | |
128 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
132 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
129 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
133 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
130 | Q_INVOKABLE void createDefaultAxes(); |
|
134 | Q_INVOKABLE void createDefaultAxes(); | |
131 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); |
|
135 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); | |
132 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); |
|
136 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); | |
133 | Q_INVOKABLE void zoom(qreal factor); |
|
137 | Q_INVOKABLE void zoom(qreal factor); | |
134 | Q_INVOKABLE void scrollLeft(qreal pixels); |
|
138 | Q_INVOKABLE void scrollLeft(qreal pixels); | |
135 | Q_INVOKABLE void scrollRight(qreal pixels); |
|
139 | Q_INVOKABLE void scrollRight(qreal pixels); | |
136 | Q_INVOKABLE void scrollUp(qreal pixels); |
|
140 | Q_INVOKABLE void scrollUp(qreal pixels); | |
137 | Q_INVOKABLE void scrollDown(qreal pixels); |
|
141 | Q_INVOKABLE void scrollDown(qreal pixels); | |
138 |
|
142 | |||
139 | Q_SIGNALS: |
|
143 | Q_SIGNALS: | |
140 | void axisLabelsChanged(); |
|
144 | void axisLabelsChanged(); | |
141 | void titleColorChanged(QColor color); |
|
145 | void titleColorChanged(QColor color); | |
142 | void backgroundColorChanged(); |
|
146 | void backgroundColorChanged(); | |
143 | void dropShadowEnabledChanged(bool enabled); |
|
147 | void dropShadowEnabledChanged(bool enabled); | |
144 | void minimumMarginsChanged(); |
|
148 | void minimumMarginsChanged(); | |
145 | void plotAreaChanged(QRectF plotArea); |
|
149 | void plotAreaChanged(QRectF plotArea); | |
146 |
|
150 | |||
147 | public Q_SLOTS: |
|
151 | public Q_SLOTS: | |
148 | void changeMinimumMargins(int top, int bottom, int left, int right); |
|
152 | void changeMinimumMargins(int top, int bottom, int left, int right); | |
149 | void handleAxisXSet(QAbstractAxis *axis); |
|
153 | void handleAxisXSet(QAbstractAxis *axis); | |
150 | void handleAxisYSet(QAbstractAxis *axis); |
|
154 | void handleAxisYSet(QAbstractAxis *axis); | |
151 |
|
155 | |||
152 | private: |
|
156 | private: | |
153 | // Extending QChart with DeclarativeChart is not possible because QObject does not support |
|
157 | // Extending QChart with DeclarativeChart is not possible because QObject does not support | |
154 | // multi inheritance, so we now have a QChart as a member instead |
|
158 | // multi inheritance, so we now have a QChart as a member instead | |
155 | QChart *m_chart; |
|
159 | QChart *m_chart; | |
156 | //QMargins m_chartMargins; |
|
160 | //QMargins m_chartMargins; | |
157 | DeclarativeMargins *m_minMargins; |
|
161 | DeclarativeMargins *m_minMargins; | |
158 | }; |
|
162 | }; | |
159 |
|
163 | |||
160 | QTCOMMERCIALCHART_END_NAMESPACE |
|
164 | QTCOMMERCIALCHART_END_NAMESPACE | |
161 |
|
165 | |||
162 | #endif // DECLARATIVECHART_H |
|
166 | #endif // DECLARATIVECHART_H |
@@ -1,90 +1,95 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVELINESERIES_H |
|
21 | #ifndef DECLARATIVELINESERIES_H | |
22 | #define DECLARATIVELINESERIES_H |
|
22 | #define DECLARATIVELINESERIES_H | |
23 |
|
23 | |||
24 | #include "qlineseries.h" |
|
24 | #include "qlineseries.h" | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include <QDeclarativeListProperty> |
|
26 | #ifdef QT5_QUICK_1 | |
27 |
#include <QDeclarative |
|
27 | #include <QtQuick1/QDeclarativeListProperty> | |
|
28 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
29 | #else | |||
|
30 | #include <QtDeclarative/QDeclarativeListProperty> | |||
|
31 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
32 | #endif | |||
28 |
|
33 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
34 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
35 | |||
31 | class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus |
|
36 | class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus | |
32 | { |
|
37 | { | |
33 | Q_OBJECT |
|
38 | Q_OBJECT | |
34 | Q_INTERFACES(QDeclarativeParserStatus) |
|
39 | Q_INTERFACES(QDeclarativeParserStatus) | |
35 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
40 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
36 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
41 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
37 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
42 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
38 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) |
|
43 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) | |
39 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) |
|
44 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) | |
40 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) |
|
45 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) | |
41 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
46 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) | |
42 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
47 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
43 |
|
48 | |||
44 | public: |
|
49 | public: | |
45 | explicit DeclarativeLineSeries(QObject *parent = 0); |
|
50 | explicit DeclarativeLineSeries(QObject *parent = 0); | |
46 | QXYSeries *xySeries() { return this; } |
|
51 | QXYSeries *xySeries() { return this; } | |
47 | QAbstractAxis *axisX() { return m_axisX; } |
|
52 | QAbstractAxis *axisX() { return m_axisX; } | |
48 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
53 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
49 | QAbstractAxis *axisY() { return m_axisY; } |
|
54 | QAbstractAxis *axisY() { return m_axisY; } | |
50 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
55 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
51 | qreal width() const; |
|
56 | qreal width() const; | |
52 | void setWidth(qreal width); |
|
57 | void setWidth(qreal width); | |
53 | Qt::PenStyle style() const; |
|
58 | Qt::PenStyle style() const; | |
54 | void setStyle(Qt::PenStyle style); |
|
59 | void setStyle(Qt::PenStyle style); | |
55 | Qt::PenCapStyle capStyle() const; |
|
60 | Qt::PenCapStyle capStyle() const; | |
56 | void setCapStyle(Qt::PenCapStyle capStyle); |
|
61 | void setCapStyle(Qt::PenCapStyle capStyle); | |
57 | QDeclarativeListProperty<QObject> declarativeChildren(); |
|
62 | QDeclarativeListProperty<QObject> declarativeChildren(); | |
58 |
|
63 | |||
59 | public: // from QDeclarativeParserStatus |
|
64 | public: // from QDeclarativeParserStatus | |
60 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
65 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
61 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
66 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
62 |
|
67 | |||
63 | public: |
|
68 | public: | |
64 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
69 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
65 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
70 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
66 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
71 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
67 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
72 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
68 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
73 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
69 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
74 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
70 |
|
75 | |||
71 | Q_SIGNALS: |
|
76 | Q_SIGNALS: | |
72 | void countChanged(int count); |
|
77 | void countChanged(int count); | |
73 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
78 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
74 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
79 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
75 | Q_REVISION(1) void widthChanged(qreal width); |
|
80 | Q_REVISION(1) void widthChanged(qreal width); | |
76 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); |
|
81 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); | |
77 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); |
|
82 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); | |
78 |
|
83 | |||
79 | public Q_SLOTS: |
|
84 | public Q_SLOTS: | |
80 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
85 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
81 | void handleCountChanged(int index); |
|
86 | void handleCountChanged(int index); | |
82 |
|
87 | |||
83 | private: |
|
88 | private: | |
84 | QAbstractAxis *m_axisX; |
|
89 | QAbstractAxis *m_axisX; | |
85 | QAbstractAxis *m_axisY; |
|
90 | QAbstractAxis *m_axisY; | |
86 | }; |
|
91 | }; | |
87 |
|
92 | |||
88 | QTCOMMERCIALCHART_END_NAMESPACE |
|
93 | QTCOMMERCIALCHART_END_NAMESPACE | |
89 |
|
94 | |||
90 | #endif // DECLARATIVELINESERIES_H |
|
95 | #endif // DECLARATIVELINESERIES_H |
@@ -1,63 +1,68 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEPIESERIES_H |
|
21 | #ifndef DECLARATIVEPIESERIES_H | |
22 | #define DECLARATIVEPIESERIES_H |
|
22 | #define DECLARATIVEPIESERIES_H | |
23 |
|
23 | |||
24 | #include "qpieseries.h" |
|
24 | #include "qpieseries.h" | |
25 | #include <QDeclarativeItem> |
|
25 | #ifdef QT5_QUICK_1 | |
26 |
#include <QDeclarative |
|
26 | #include <QtQuick1/QDeclarativeItem> | |
|
27 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
28 | #else | |||
|
29 | #include <QtDeclarative/QDeclarativeItem> | |||
|
30 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
31 | #endif | |||
27 |
|
32 | |||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
33 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
29 | class QPieSlice; |
|
34 | class QPieSlice; | |
30 |
|
35 | |||
31 | class DeclarativePieSeries : public QPieSeries, public QDeclarativeParserStatus |
|
36 | class DeclarativePieSeries : public QPieSeries, public QDeclarativeParserStatus | |
32 | { |
|
37 | { | |
33 | Q_OBJECT |
|
38 | Q_OBJECT | |
34 | Q_INTERFACES(QDeclarativeParserStatus) |
|
39 | Q_INTERFACES(QDeclarativeParserStatus) | |
35 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
40 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
36 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
41 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
37 |
|
42 | |||
38 | public: |
|
43 | public: | |
39 | explicit DeclarativePieSeries(QDeclarativeItem *parent = 0); |
|
44 | explicit DeclarativePieSeries(QDeclarativeItem *parent = 0); | |
40 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
45 | QDeclarativeListProperty<QObject> seriesChildren(); | |
41 | Q_INVOKABLE QPieSlice *at(int index); |
|
46 | Q_INVOKABLE QPieSlice *at(int index); | |
42 | Q_INVOKABLE QPieSlice *find(QString label); |
|
47 | Q_INVOKABLE QPieSlice *find(QString label); | |
43 | Q_INVOKABLE QPieSlice *append(QString label, qreal value); |
|
48 | Q_INVOKABLE QPieSlice *append(QString label, qreal value); | |
44 | Q_INVOKABLE bool remove(QPieSlice *slice); |
|
49 | Q_INVOKABLE bool remove(QPieSlice *slice); | |
45 | Q_INVOKABLE void clear(); |
|
50 | Q_INVOKABLE void clear(); | |
46 |
|
51 | |||
47 | public: |
|
52 | public: | |
48 | void classBegin(); |
|
53 | void classBegin(); | |
49 | void componentComplete(); |
|
54 | void componentComplete(); | |
50 |
|
55 | |||
51 | Q_SIGNALS: |
|
56 | Q_SIGNALS: | |
52 | void sliceAdded(QPieSlice* slice); |
|
57 | void sliceAdded(QPieSlice* slice); | |
53 | void sliceRemoved(QPieSlice* slice); |
|
58 | void sliceRemoved(QPieSlice* slice); | |
54 |
|
59 | |||
55 | public Q_SLOTS: |
|
60 | public Q_SLOTS: | |
56 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
61 | static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
57 | void handleAdded(QList<QPieSlice*> slices); |
|
62 | void handleAdded(QList<QPieSlice*> slices); | |
58 | void handleRemoved(QList<QPieSlice*> slices); |
|
63 | void handleRemoved(QList<QPieSlice*> slices); | |
59 | }; |
|
64 | }; | |
60 |
|
65 | |||
61 | QTCOMMERCIALCHART_END_NAMESPACE |
|
66 | QTCOMMERCIALCHART_END_NAMESPACE | |
62 |
|
67 | |||
63 | #endif // DECLARATIVEPIESERIES_H |
|
68 | #endif // DECLARATIVEPIESERIES_H |
@@ -1,82 +1,87 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVESCATTERSERIES_H |
|
21 | #ifndef DECLARATIVESCATTERSERIES_H | |
22 | #define DECLARATIVESCATTERSERIES_H |
|
22 | #define DECLARATIVESCATTERSERIES_H | |
23 |
|
23 | |||
24 | #include "qscatterseries.h" |
|
24 | #include "qscatterseries.h" | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include <QDeclarativeListProperty> |
|
26 | #ifdef QT5_QUICK_1 | |
27 |
#include <QDeclarative |
|
27 | #include <QtQuick1/QDeclarativeListProperty> | |
|
28 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
29 | #else | |||
|
30 | #include <QtDeclarative/QDeclarativeListProperty> | |||
|
31 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
32 | #endif | |||
28 |
|
33 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
34 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
35 | |||
31 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QDeclarativeParserStatus |
|
36 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QDeclarativeParserStatus | |
32 | { |
|
37 | { | |
33 | Q_OBJECT |
|
38 | Q_OBJECT | |
34 | Q_INTERFACES(QDeclarativeParserStatus) |
|
39 | Q_INTERFACES(QDeclarativeParserStatus) | |
35 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
40 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
36 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
41 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
37 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
42 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
38 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
43 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
39 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
44 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) | |
40 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
45 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
41 |
|
46 | |||
42 | public: |
|
47 | public: | |
43 | explicit DeclarativeScatterSeries(QObject *parent = 0); |
|
48 | explicit DeclarativeScatterSeries(QObject *parent = 0); | |
44 | QXYSeries *xySeries() { return this; } |
|
49 | QXYSeries *xySeries() { return this; } | |
45 | QAbstractAxis *axisX() { return m_axisX; } |
|
50 | QAbstractAxis *axisX() { return m_axisX; } | |
46 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
51 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
47 | QAbstractAxis *axisY() { return m_axisY; } |
|
52 | QAbstractAxis *axisY() { return m_axisY; } | |
48 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
53 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
49 | qreal borderWidth() const; |
|
54 | qreal borderWidth() const; | |
50 | void setBorderWidth(qreal borderWidth); |
|
55 | void setBorderWidth(qreal borderWidth); | |
51 | QDeclarativeListProperty<QObject> declarativeChildren(); |
|
56 | QDeclarativeListProperty<QObject> declarativeChildren(); | |
52 |
|
57 | |||
53 | public: // from QDeclarativeParserStatus |
|
58 | public: // from QDeclarativeParserStatus | |
54 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
59 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
55 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
60 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
56 |
|
61 | |||
57 | public: |
|
62 | public: | |
58 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
63 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
59 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
64 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
60 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
65 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
61 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
66 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
62 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
67 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
63 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
68 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
64 |
|
69 | |||
65 | Q_SIGNALS: |
|
70 | Q_SIGNALS: | |
66 | void countChanged(int count); |
|
71 | void countChanged(int count); | |
67 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
72 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
68 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
73 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
69 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
74 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
70 |
|
75 | |||
71 | public Q_SLOTS: |
|
76 | public Q_SLOTS: | |
72 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
77 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
73 | void handleCountChanged(int index); |
|
78 | void handleCountChanged(int index); | |
74 |
|
79 | |||
75 | private: |
|
80 | private: | |
76 | QAbstractAxis *m_axisX; |
|
81 | QAbstractAxis *m_axisX; | |
77 | QAbstractAxis *m_axisY; |
|
82 | QAbstractAxis *m_axisY; | |
78 | }; |
|
83 | }; | |
79 |
|
84 | |||
80 | QTCOMMERCIALCHART_END_NAMESPACE |
|
85 | QTCOMMERCIALCHART_END_NAMESPACE | |
81 |
|
86 | |||
82 | #endif // DECLARATIVESCATTERSERIES_H |
|
87 | #endif // DECLARATIVESCATTERSERIES_H |
@@ -1,90 +1,95 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVESPLINESERIES_H |
|
21 | #ifndef DECLARATIVESPLINESERIES_H | |
22 | #define DECLARATIVESPLINESERIES_H |
|
22 | #define DECLARATIVESPLINESERIES_H | |
23 |
|
23 | |||
24 | #include "qsplineseries.h" |
|
24 | #include "qsplineseries.h" | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include <QDeclarativeParserStatus> |
|
26 | #ifdef QT5_QUICK_1 | |
27 | #include <QDeclarativeListProperty> |
|
27 | #include <QtQuick1/QDeclarativeListProperty> | |
|
28 | #include <QtQuick1/QDeclarativeParserStatus> | |||
|
29 | #else | |||
|
30 | #include <QtDeclarative/QDeclarativeListProperty> | |||
|
31 | #include <QtDeclarative/QDeclarativeParserStatus> | |||
|
32 | #endif | |||
28 |
|
33 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
34 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
35 | |||
31 | class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus |
|
36 | class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus | |
32 | { |
|
37 | { | |
33 | Q_OBJECT |
|
38 | Q_OBJECT | |
34 | Q_INTERFACES(QDeclarativeParserStatus) |
|
39 | Q_INTERFACES(QDeclarativeParserStatus) | |
35 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
40 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
36 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
41 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
37 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
42 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
38 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) |
|
43 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) | |
39 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) |
|
44 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) | |
40 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) |
|
45 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) | |
41 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
46 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) | |
42 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
47 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
43 |
|
48 | |||
44 | public: |
|
49 | public: | |
45 | explicit DeclarativeSplineSeries(QObject *parent = 0); |
|
50 | explicit DeclarativeSplineSeries(QObject *parent = 0); | |
46 | QXYSeries *xySeries() { return this; } |
|
51 | QXYSeries *xySeries() { return this; } | |
47 | QAbstractAxis *axisX() { return m_axisX; } |
|
52 | QAbstractAxis *axisX() { return m_axisX; } | |
48 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } |
|
53 | void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); } | |
49 | QAbstractAxis *axisY() { return m_axisY; } |
|
54 | QAbstractAxis *axisY() { return m_axisY; } | |
50 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } |
|
55 | void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); } | |
51 | qreal width() const; |
|
56 | qreal width() const; | |
52 | void setWidth(qreal width); |
|
57 | void setWidth(qreal width); | |
53 | Qt::PenStyle style() const; |
|
58 | Qt::PenStyle style() const; | |
54 | void setStyle(Qt::PenStyle style); |
|
59 | void setStyle(Qt::PenStyle style); | |
55 | Qt::PenCapStyle capStyle() const; |
|
60 | Qt::PenCapStyle capStyle() const; | |
56 | void setCapStyle(Qt::PenCapStyle capStyle); |
|
61 | void setCapStyle(Qt::PenCapStyle capStyle); | |
57 | QDeclarativeListProperty<QObject> declarativeChildren(); |
|
62 | QDeclarativeListProperty<QObject> declarativeChildren(); | |
58 |
|
63 | |||
59 | public: // from QDeclarativeParserStatus |
|
64 | public: // from QDeclarativeParserStatus | |
60 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
65 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
61 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
66 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
62 |
|
67 | |||
63 | public: |
|
68 | public: | |
64 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
69 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
65 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
70 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
66 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
71 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
67 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
72 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
68 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
73 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
69 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
74 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
70 |
|
75 | |||
71 | Q_SIGNALS: |
|
76 | Q_SIGNALS: | |
72 | void countChanged(int count); |
|
77 | void countChanged(int count); | |
73 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
78 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
74 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
79 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
75 | Q_REVISION(1) void widthChanged(qreal width); |
|
80 | Q_REVISION(1) void widthChanged(qreal width); | |
76 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); |
|
81 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); | |
77 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); |
|
82 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); | |
78 |
|
83 | |||
79 | public Q_SLOTS: |
|
84 | public Q_SLOTS: | |
80 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); |
|
85 | static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element); | |
81 | void handleCountChanged(int index); |
|
86 | void handleCountChanged(int index); | |
82 |
|
87 | |||
83 | public: |
|
88 | public: | |
84 | QAbstractAxis *m_axisX; |
|
89 | QAbstractAxis *m_axisX; | |
85 | QAbstractAxis *m_axisY; |
|
90 | QAbstractAxis *m_axisY; | |
86 | }; |
|
91 | }; | |
87 |
|
92 | |||
88 | QTCOMMERCIALCHART_END_NAMESPACE |
|
93 | QTCOMMERCIALCHART_END_NAMESPACE | |
89 |
|
94 | |||
90 | #endif // DECLARATIVESPLINESERIES_H |
|
95 | #endif // DECLARATIVESPLINESERIES_H |
@@ -1,165 +1,177 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include <QtDeclarative/qdeclarativeextensionplugin.h> |
|
21 | #ifdef QT5_QUICK_1 | |
22 |
#include <Qt |
|
22 | #include <QtQuick1/qdeclarativeextensionplugin.h> | |
|
23 | #include <QtQuick1/qdeclarative.h> | |||
|
24 | #else | |||
|
25 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | |||
|
26 | #include <QtDeclarative/qdeclarative.h> | |||
|
27 | #endif | |||
23 | #include "qchart.h" |
|
28 | #include "qchart.h" | |
24 | #include "qabstractaxis.h" |
|
29 | #include "qabstractaxis.h" | |
25 | #include "qvalueaxis.h" |
|
30 | #include "qvalueaxis.h" | |
26 | #include "declarativecategoryaxis.h" |
|
31 | #include "declarativecategoryaxis.h" | |
27 | #include "qbarcategoryaxis.h" |
|
32 | #include "qbarcategoryaxis.h" | |
28 | #include "declarativechart.h" |
|
33 | #include "declarativechart.h" | |
29 | #include "declarativexypoint.h" |
|
34 | #include "declarativexypoint.h" | |
30 | #include "declarativelineseries.h" |
|
35 | #include "declarativelineseries.h" | |
31 | #include "declarativesplineseries.h" |
|
36 | #include "declarativesplineseries.h" | |
32 | #include "declarativeareaseries.h" |
|
37 | #include "declarativeareaseries.h" | |
33 | #include "declarativescatterseries.h" |
|
38 | #include "declarativescatterseries.h" | |
34 | #include "declarativebarseries.h" |
|
39 | #include "declarativebarseries.h" | |
35 | #include "declarativepieseries.h" |
|
40 | #include "declarativepieseries.h" | |
36 | #include "qvxymodelmapper.h" |
|
41 | #include "qvxymodelmapper.h" | |
37 | #include "qhxymodelmapper.h" |
|
42 | #include "qhxymodelmapper.h" | |
38 | #include "qhpiemodelmapper.h" |
|
43 | #include "qhpiemodelmapper.h" | |
39 | #include "qvpiemodelmapper.h" |
|
44 | #include "qvpiemodelmapper.h" | |
40 | #include "qhbarmodelmapper.h" |
|
45 | #include "qhbarmodelmapper.h" | |
41 | #include "qvbarmodelmapper.h" |
|
46 | #include "qvbarmodelmapper.h" | |
42 | #include "declarativemargins.h" |
|
47 | #include "declarativemargins.h" | |
43 | #include <QAbstractItemModel> |
|
48 | #include <QAbstractItemModel> | |
44 |
|
49 | |||
45 | #ifndef QT_ON_ARM |
|
50 | #ifndef QT_ON_ARM | |
46 | #include "qdatetimeaxis.h" |
|
51 | #include "qdatetimeaxis.h" | |
47 | #endif |
|
52 | #endif | |
48 |
|
53 | |||
49 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
54 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
50 |
|
55 | |||
51 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin |
|
56 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin | |
52 | { |
|
57 | { | |
53 | Q_OBJECT |
|
58 | Q_OBJECT | |
|
59 | ||||
|
60 | #ifdef QT5_QUICK_1 | |||
|
61 | Q_PLUGIN_METADATA(IID "org.qt-project.foo") | |||
|
62 | #endif | |||
|
63 | ||||
54 | public: |
|
64 | public: | |
55 | virtual void registerTypes(const char *uri) |
|
65 | virtual void registerTypes(const char *uri) | |
56 | { |
|
66 | { | |
57 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); |
|
67 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); | |
58 |
|
68 | |||
59 | // QtCommercial.Chart 1.0 |
|
69 | // QtCommercial.Chart 1.0 | |
60 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); |
|
70 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); | |
61 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); |
|
71 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); | |
62 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); |
|
72 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); | |
63 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); |
|
73 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); | |
64 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); |
|
74 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); | |
65 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); |
|
75 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); | |
66 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); |
|
76 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | |
67 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); |
|
77 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); | |
68 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); |
|
78 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); | |
69 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); |
|
79 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | |
70 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); |
|
80 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | |
71 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); |
|
81 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); | |
72 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); |
|
82 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); | |
73 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); |
|
83 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); | |
74 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); |
|
84 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); | |
75 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); |
|
85 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); | |
76 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); |
|
86 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); | |
77 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); |
|
87 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); | |
78 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); |
|
88 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); | |
79 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); |
|
89 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); | |
80 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", |
|
90 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", | |
81 | QLatin1String("Trying to create uncreatable: Legend.")); |
|
91 | QLatin1String("Trying to create uncreatable: Legend.")); | |
82 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", |
|
92 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", | |
83 | QLatin1String("Trying to create uncreatable: XYSeries.")); |
|
93 | QLatin1String("Trying to create uncreatable: XYSeries.")); | |
84 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", |
|
94 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", | |
85 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); |
|
95 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | |
86 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", |
|
96 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | |
87 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); |
|
97 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | |
88 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", |
|
98 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | |
89 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); |
|
99 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); | |
90 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", |
|
100 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", | |
91 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); |
|
101 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); | |
92 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", |
|
102 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", | |
93 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); |
|
103 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); | |
94 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", |
|
104 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", | |
95 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); |
|
105 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); | |
96 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", |
|
106 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", | |
97 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); |
|
107 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); | |
98 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", |
|
108 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", | |
99 | QLatin1String("Trying to create uncreatable: BarsetBase.")); |
|
109 | QLatin1String("Trying to create uncreatable: BarsetBase.")); | |
100 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", |
|
110 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", | |
101 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); |
|
111 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); | |
102 |
|
112 | |||
103 | // QtCommercial.Chart 1.1 |
|
113 | // QtCommercial.Chart 1.1 | |
104 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); |
|
114 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); | |
105 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 1, "XYPoint"); |
|
115 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 1, "XYPoint"); | |
106 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); |
|
116 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); | |
107 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); |
|
117 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); | |
108 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); |
|
118 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); | |
109 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); |
|
119 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); | |
110 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); |
|
120 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); | |
111 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); |
|
121 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); | |
112 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); |
|
122 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); | |
113 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); |
|
123 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); | |
114 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); |
|
124 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); | |
115 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); |
|
125 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); | |
116 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); |
|
126 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); | |
117 | qmlRegisterType<QPieSlice>(uri, 1, 1, "PieSlice"); |
|
127 | qmlRegisterType<QPieSlice>(uri, 1, 1, "PieSlice"); | |
118 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); |
|
128 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); | |
119 | qmlRegisterType<QHXYModelMapper>(uri, 1, 1, "HXYModelMapper"); |
|
129 | qmlRegisterType<QHXYModelMapper>(uri, 1, 1, "HXYModelMapper"); | |
120 | qmlRegisterType<QVXYModelMapper>(uri, 1, 1, "VXYModelMapper"); |
|
130 | qmlRegisterType<QVXYModelMapper>(uri, 1, 1, "VXYModelMapper"); | |
121 | qmlRegisterType<QHPieModelMapper>(uri, 1, 1, "HPieModelMapper"); |
|
131 | qmlRegisterType<QHPieModelMapper>(uri, 1, 1, "HPieModelMapper"); | |
122 | qmlRegisterType<QVPieModelMapper>(uri, 1, 1, "VPieModelMapper"); |
|
132 | qmlRegisterType<QVPieModelMapper>(uri, 1, 1, "VPieModelMapper"); | |
123 | qmlRegisterType<QHBarModelMapper>(uri, 1, 1, "HBarModelMapper"); |
|
133 | qmlRegisterType<QHBarModelMapper>(uri, 1, 1, "HBarModelMapper"); | |
124 | qmlRegisterType<QVBarModelMapper>(uri, 1, 1, "VBarModelMapper"); |
|
134 | qmlRegisterType<QVBarModelMapper>(uri, 1, 1, "VBarModelMapper"); | |
125 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); |
|
135 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); | |
126 | #ifndef QT_ON_ARM |
|
136 | #ifndef QT_ON_ARM | |
127 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); |
|
137 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); | |
128 | #endif |
|
138 | #endif | |
129 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); |
|
139 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); | |
130 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); |
|
140 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); | |
131 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); |
|
141 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); | |
132 | qmlRegisterUncreatableType<QLegend>(uri, 1, 1, "Legend", |
|
142 | qmlRegisterUncreatableType<QLegend>(uri, 1, 1, "Legend", | |
133 | QLatin1String("Trying to create uncreatable: Legend.")); |
|
143 | QLatin1String("Trying to create uncreatable: Legend.")); | |
134 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 1, "XYSeries", |
|
144 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 1, "XYSeries", | |
135 | QLatin1String("Trying to create uncreatable: XYSeries.")); |
|
145 | QLatin1String("Trying to create uncreatable: XYSeries.")); | |
136 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 1, "AbstractItemModel", |
|
146 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 1, "AbstractItemModel", | |
137 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); |
|
147 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | |
138 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 1, "XYModelMapper", |
|
148 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 1, "XYModelMapper", | |
139 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); |
|
149 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | |
140 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 1, "PieModelMapper", |
|
150 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 1, "PieModelMapper", | |
141 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); |
|
151 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); | |
142 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 1, "BarModelMapper", |
|
152 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 1, "BarModelMapper", | |
143 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); |
|
153 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); | |
144 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 1, "AbstractSeries", |
|
154 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 1, "AbstractSeries", | |
145 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); |
|
155 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); | |
146 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 1, "AbstractBarSeries", |
|
156 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 1, "AbstractBarSeries", | |
147 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); |
|
157 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); | |
148 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 1, "AbstractAxis", |
|
158 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 1, "AbstractAxis", | |
149 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); |
|
159 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); | |
150 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 1, "BarSetBase", |
|
160 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 1, "BarSetBase", | |
151 | QLatin1String("Trying to create uncreatable: BarsetBase.")); |
|
161 | QLatin1String("Trying to create uncreatable: BarsetBase.")); | |
152 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 1, "QPieSeries", |
|
162 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 1, "QPieSeries", | |
153 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); |
|
163 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); | |
154 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", |
|
164 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", | |
155 | QLatin1String("Trying to create uncreatable: Margins.")); |
|
165 | QLatin1String("Trying to create uncreatable: Margins.")); | |
156 | } |
|
166 | } | |
157 | }; |
|
167 | }; | |
158 |
|
168 | |||
159 | #include "plugin.moc" |
|
169 | #include "plugin.moc" | |
160 |
|
170 | |||
161 | QTCOMMERCIALCHART_END_NAMESPACE |
|
171 | QTCOMMERCIALCHART_END_NAMESPACE | |
162 |
|
172 | |||
163 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
173 | QTCOMMERCIALCHART_USE_NAMESPACE | |
164 |
|
174 | |||
165 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) |
|
175 | #ifndef QT5_QUICK_1 | |
|
176 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | |||
|
177 | #endif |
@@ -1,16 +1,16 | |||||
1 | !include( ../config.pri ) { |
|
1 | !include( ../config.pri ) { | |
2 | error( "Couldn't find the config.pri file!" ) |
|
2 | error( "Couldn't find the config.pri file!" ) | |
3 | } |
|
3 | } | |
4 |
|
4 | |||
5 | TEMPLATE = subdirs |
|
5 | TEMPLATE = subdirs | |
6 |
|
6 | |||
7 | contains(QT_VERSION, ^4\\.[0-7]\\.[0-3]\\s*$) | contains(QT_VERSION, ^4\\.[0-6]\\..*) { |
|
7 | contains(QT_VERSION, ^4\\.[0-7]\\.[0-3]\\s*$) | contains(QT_VERSION, ^4\\.[0-6]\\..*) { | |
8 | warning("QtCommercial.Charts QML API requires at least Qt 4.7.4. You are using $${QT_VERSION} so the QML API is disabled.") |
|
8 | warning("QtCommercial.Charts QML API requires at least Qt 4.7.4. You are using $${QT_VERSION} so the QML API is disabled.") | |
9 | } else { |
|
9 | } else { | |
10 | SUBDIRS += declarative |
|
10 | SUBDIRS += declarative | |
11 | } |
|
11 | } | |
12 |
|
12 | |||
13 | !linux-arm*: { |
|
13 | !linux-arm*: { | |
14 | SUBDIRS += \ |
|
14 | # SUBDIRS += \ | |
15 | designer |
|
15 | # designer | |
16 | } |
|
16 | } |
@@ -1,254 +1,254 | |||||
1 | !include( ../config.pri ):error( "Couldn't find the config.pri file!" ) |
|
1 | !include( ../config.pri ):error( "Couldn't find the config.pri file!" ) | |
2 |
|
2 | |||
3 | ############################# BUILD CONFIG ###################################### |
|
3 | ############################# BUILD CONFIG ###################################### | |
4 |
|
4 | |||
5 | TARGET = $$LIBRARY_NAME |
|
5 | TARGET = $$LIBRARY_NAME | |
6 | DESTDIR = $$CHART_BUILD_LIB_DIR |
|
6 | DESTDIR = $$CHART_BUILD_LIB_DIR | |
7 | TEMPLATE = lib |
|
7 | TEMPLATE = lib | |
8 | QT = core gui |
|
8 | QT = core gui | |
9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets |
|
9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | |
10 | DEFINES += QTCOMMERCIALCHART_LIBRARY |
|
10 | DEFINES += QTCOMMERCIALCHART_LIBRARY | |
11 | win32:CONFIG += create_prl |
|
11 | win32:CONFIG += create_prl | |
12 | # treat warnings as errors |
|
12 | # treat warnings as errors | |
13 | win32-msvc*: { |
|
13 | win32-msvc*: { | |
14 | QMAKE_CXXFLAGS += /WX |
|
14 | QMAKE_CXXFLAGS += /WX | |
15 | } else { |
|
15 | } else { | |
16 |
QMAKE_CXXFLAGS += -Werror |
|
16 | # QMAKE_CXXFLAGS += -Werror | |
17 | } |
|
17 | } | |
18 |
|
18 | |||
19 | unix:{ |
|
19 | unix:{ | |
20 | QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden |
|
20 | QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden | |
21 | } |
|
21 | } | |
22 |
|
22 | |||
23 | ############################# DEPEDENCES ######################################## |
|
23 | ############################# DEPEDENCES ######################################## | |
24 |
|
24 | |||
25 | win32-msvc*: LIBS += User32.lib |
|
25 | win32-msvc*: LIBS += User32.lib | |
26 | LIBS -= -l$$LIBRARY_NAME |
|
26 | LIBS -= -l$$LIBRARY_NAME | |
27 | INCLUDEPATH += ../include . |
|
27 | INCLUDEPATH += ../include . | |
28 |
|
28 | |||
29 | ############################# SOURCES ########################################## |
|
29 | ############################# SOURCES ########################################## | |
30 |
|
30 | |||
31 | SOURCES += \ |
|
31 | SOURCES += \ | |
32 | $$PWD/chartdataset.cpp \ |
|
32 | $$PWD/chartdataset.cpp \ | |
33 | $$PWD/chartpresenter.cpp \ |
|
33 | $$PWD/chartpresenter.cpp \ | |
34 | $$PWD/charttheme.cpp \ |
|
34 | $$PWD/charttheme.cpp \ | |
35 | $$PWD/domain.cpp \ |
|
35 | $$PWD/domain.cpp \ | |
36 | $$PWD/qchart.cpp \ |
|
36 | $$PWD/qchart.cpp \ | |
37 | $$PWD/qchartview.cpp \ |
|
37 | $$PWD/qchartview.cpp \ | |
38 | $$PWD/qabstractseries.cpp \ |
|
38 | $$PWD/qabstractseries.cpp \ | |
39 | $$PWD/chartbackground.cpp \ |
|
39 | $$PWD/chartbackground.cpp \ | |
40 | $$PWD/chartelement.cpp \ |
|
40 | $$PWD/chartelement.cpp \ | |
41 | $$PWD/scroller.cpp \ |
|
41 | $$PWD/scroller.cpp \ | |
42 | $$PWD/chartlayout.cpp \ |
|
42 | $$PWD/chartlayout.cpp \ | |
43 | $$PWD/charttitle.cpp |
|
43 | $$PWD/charttitle.cpp | |
44 | PRIVATE_HEADERS += \ |
|
44 | PRIVATE_HEADERS += \ | |
45 | $$PWD/chartdataset_p.h \ |
|
45 | $$PWD/chartdataset_p.h \ | |
46 | $$PWD/chartitem_p.h \ |
|
46 | $$PWD/chartitem_p.h \ | |
47 | $$PWD/chartpresenter_p.h \ |
|
47 | $$PWD/chartpresenter_p.h \ | |
48 | $$PWD/charttheme_p.h \ |
|
48 | $$PWD/charttheme_p.h \ | |
49 | $$PWD/domain_p.h \ |
|
49 | $$PWD/domain_p.h \ | |
50 | $$PWD/chartbackground_p.h \ |
|
50 | $$PWD/chartbackground_p.h \ | |
51 | $$PWD/chartelement_p.h \ |
|
51 | $$PWD/chartelement_p.h \ | |
52 | $$PWD/chartconfig_p.h \ |
|
52 | $$PWD/chartconfig_p.h \ | |
53 | $$PWD/qchart_p.h \ |
|
53 | $$PWD/qchart_p.h \ | |
54 | $$PWD/qchartview_p.h \ |
|
54 | $$PWD/qchartview_p.h \ | |
55 | $$PWD/scroller_p.h \ |
|
55 | $$PWD/scroller_p.h \ | |
56 | $$PWD/qabstractseries_p.h \ |
|
56 | $$PWD/qabstractseries_p.h \ | |
57 | $$PWD/chartlayout_p.h \ |
|
57 | $$PWD/chartlayout_p.h \ | |
58 | $$PWD/charttitle_p.h |
|
58 | $$PWD/charttitle_p.h | |
59 | PUBLIC_HEADERS += \ |
|
59 | PUBLIC_HEADERS += \ | |
60 | $$PWD/qchart.h \ |
|
60 | $$PWD/qchart.h \ | |
61 | $$PWD/qchartglobal.h \ |
|
61 | $$PWD/qchartglobal.h \ | |
62 | $$PWD/qabstractseries.h \ |
|
62 | $$PWD/qabstractseries.h \ | |
63 | $$PWD/qchartview.h \ |
|
63 | $$PWD/qchartview.h \ | |
64 | $$PWD/chartsnamespace.h |
|
64 | $$PWD/chartsnamespace.h | |
65 |
|
65 | |||
66 | include(animations/animations.pri) |
|
66 | include(animations/animations.pri) | |
67 | include(areachart/areachart.pri) |
|
67 | include(areachart/areachart.pri) | |
68 | include(axis/axis.pri) |
|
68 | include(axis/axis.pri) | |
69 | include(barchart/barchart.pri) |
|
69 | include(barchart/barchart.pri) | |
70 | include(legend/legend.pri) |
|
70 | include(legend/legend.pri) | |
71 | include(linechart/linechart.pri) |
|
71 | include(linechart/linechart.pri) | |
72 | include(piechart/piechart.pri) |
|
72 | include(piechart/piechart.pri) | |
73 | include(scatterchart/scatter.pri) |
|
73 | include(scatterchart/scatter.pri) | |
74 | include(splinechart/splinechart.pri) |
|
74 | include(splinechart/splinechart.pri) | |
75 | include(themes/themes.pri) |
|
75 | include(themes/themes.pri) | |
76 | include(xychart/xychart.pri) |
|
76 | include(xychart/xychart.pri) | |
77 |
|
77 | |||
78 | HEADERS += $$PUBLIC_HEADERS |
|
78 | HEADERS += $$PUBLIC_HEADERS | |
79 | HEADERS += $$PRIVATE_HEADERS |
|
79 | HEADERS += $$PRIVATE_HEADERS | |
80 | HEADERS += $$THEMES |
|
80 | HEADERS += $$THEMES | |
81 |
|
81 | |||
82 | ############################# BUILD PATH ########################################## |
|
82 | ############################# BUILD PATH ########################################## | |
83 |
|
83 | |||
84 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
84 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib | |
85 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
85 | MOC_DIR = $$CHART_BUILD_DIR/lib | |
86 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
86 | UI_DIR = $$CHART_BUILD_DIR/lib | |
87 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
87 | RCC_DIR = $$CHART_BUILD_DIR/lib | |
88 |
|
88 | |||
89 | ############################# PUBLIC HEADERS GENERATOR ########################################## |
|
89 | ############################# PUBLIC HEADERS GENERATOR ########################################## | |
90 |
|
90 | |||
91 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) |
|
91 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) | |
92 | { |
|
92 | { | |
93 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) |
|
93 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) | |
94 | win32:{ |
|
94 | win32:{ | |
95 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
95 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" | |
96 | }else{ |
|
96 | }else{ | |
97 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
97 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" | |
98 | } |
|
98 | } | |
99 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal |
|
99 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal | |
100 | system($$command) |
|
100 | system($$command) | |
101 | } |
|
101 | } | |
102 |
|
102 | |||
103 | for(file, PUBLIC_HEADERS) { |
|
103 | for(file, PUBLIC_HEADERS) { | |
104 | name = $$split(file,'/') |
|
104 | name = $$split(file,'/') | |
105 | name = $$last(name) |
|
105 | name = $$last(name) | |
106 | class = "$$cat($$file)" |
|
106 | class = "$$cat($$file)" | |
107 | class = $$find(class,class) |
|
107 | class = $$find(class,class) | |
108 | !isEmpty(class){ |
|
108 | !isEmpty(class){ | |
109 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) |
|
109 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) | |
110 | class = $$member(class,1) |
|
110 | class = $$member(class,1) | |
111 | class = $$split(class,' ') |
|
111 | class = $$split(class,' ') | |
112 | class = $$replace(class,' ','') |
|
112 | class = $$replace(class,' ','') | |
113 | class = $$member(class,0) |
|
113 | class = $$member(class,0) | |
114 | win32:{ |
|
114 | win32:{ | |
115 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
115 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" | |
116 | }else{ |
|
116 | }else{ | |
117 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
117 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" | |
118 | } |
|
118 | } | |
119 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class |
|
119 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class | |
120 | system($$command) |
|
120 | system($$command) | |
121 | } |
|
121 | } | |
122 | } |
|
122 | } | |
123 |
|
123 | |||
124 | ############################# INSTALLERS ########################################## |
|
124 | ############################# INSTALLERS ########################################## | |
125 |
|
125 | |||
126 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
126 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart | |
127 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS |
|
127 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS | |
128 | INSTALLS += public_headers |
|
128 | INSTALLS += public_headers | |
129 |
|
129 | |||
130 | install_build_public_headers.name = build_public_headers |
|
130 | install_build_public_headers.name = build_public_headers | |
131 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
131 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h | |
132 | install_build_public_headers.input = PUBLIC_HEADERS |
|
132 | install_build_public_headers.input = PUBLIC_HEADERS | |
133 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
133 | install_build_public_headers.commands = $$QMAKE_COPY \ | |
134 | ${QMAKE_FILE_NAME} \ |
|
134 | ${QMAKE_FILE_NAME} \ | |
135 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
135 | $$CHART_BUILD_PUBLIC_HEADER_DIR | |
136 | install_build_public_headers.CONFIG += target_predeps \ |
|
136 | install_build_public_headers.CONFIG += target_predeps \ | |
137 | no_link |
|
137 | no_link | |
138 |
|
138 | |||
139 | install_build_private_headers.name = build_private_headers |
|
139 | install_build_private_headers.name = build_private_headers | |
140 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
140 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h | |
141 | install_build_private_headers.input = PRIVATE_HEADERS |
|
141 | install_build_private_headers.input = PRIVATE_HEADERS | |
142 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
142 | install_build_private_headers.commands = $$QMAKE_COPY \ | |
143 | ${QMAKE_FILE_NAME} \ |
|
143 | ${QMAKE_FILE_NAME} \ | |
144 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
144 | $$CHART_BUILD_PRIVATE_HEADER_DIR | |
145 | install_build_private_headers.CONFIG += target_predeps \ |
|
145 | install_build_private_headers.CONFIG += target_predeps \ | |
146 | no_link |
|
146 | no_link | |
147 |
|
147 | |||
148 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
148 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ | |
149 | install_build_private_headers \ |
|
149 | install_build_private_headers \ | |
150 |
|
150 | |||
151 | win32:{ |
|
151 | win32:{ | |
152 | bintarget.CONFIG += no_check_exist |
|
152 | bintarget.CONFIG += no_check_exist | |
153 | !staticlib: { |
|
153 | !staticlib: { | |
154 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll |
|
154 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll | |
155 | } |
|
155 | } | |
156 | win32-msvc*:CONFIG(debug, debug|release): { |
|
156 | win32-msvc*:CONFIG(debug, debug|release): { | |
157 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb |
|
157 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb | |
158 | } |
|
158 | } | |
159 | bintarget.path = $$[QT_INSTALL_BINS] |
|
159 | bintarget.path = $$[QT_INSTALL_BINS] | |
160 |
|
160 | |||
161 | libtarget.CONFIG += no_check_exist |
|
161 | libtarget.CONFIG += no_check_exist | |
162 | libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl |
|
162 | libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl | |
163 | win32-msvc*: { |
|
163 | win32-msvc*: { | |
164 | libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib |
|
164 | libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib | |
165 | } else { |
|
165 | } else { | |
166 | libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a |
|
166 | libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a | |
167 | } |
|
167 | } | |
168 | libtarget.path = $$[QT_INSTALL_LIBS] |
|
168 | libtarget.path = $$[QT_INSTALL_LIBS] | |
169 |
|
169 | |||
170 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR |
|
170 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR | |
171 | INSTALLS += bintarget libtarget |
|
171 | INSTALLS += bintarget libtarget | |
172 | }else{ |
|
172 | }else{ | |
173 | target.path=$$[QT_INSTALL_LIBS] |
|
173 | target.path=$$[QT_INSTALL_LIBS] | |
174 | INSTALLS += target |
|
174 | INSTALLS += target | |
175 | } |
|
175 | } | |
176 |
|
176 | |||
177 | mac: !staticlib: { |
|
177 | mac: !staticlib: { | |
178 | # Update the name (id) of the library on OSX to point to the lib path |
|
178 | # Update the name (id) of the library on OSX to point to the lib path | |
179 | MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib" |
|
179 | MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib" | |
180 | QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME" |
|
180 | QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME" | |
181 |
|
181 | |||
182 | # Update the name (id) of the installed library on OSX to point to the installation path |
|
182 | # Update the name (id) of the installed library on OSX to point to the installation path | |
183 | postinstall.path = $$[QT_INSTALL_LIBS] |
|
183 | postinstall.path = $$[QT_INSTALL_LIBS] | |
184 | postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME" |
|
184 | postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME" | |
185 | INSTALLS += postinstall |
|
185 | INSTALLS += postinstall | |
186 | } |
|
186 | } | |
187 |
|
187 | |||
188 | ################################ DEVELOPMENT BUILD ########################################## |
|
188 | ################################ DEVELOPMENT BUILD ########################################## | |
189 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. |
|
189 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. | |
190 | # This is the case at least with shadow builds. |
|
190 | # This is the case at least with shadow builds. | |
191 | # http://qt-project.org/wiki/jom |
|
191 | # http://qt-project.org/wiki/jom | |
192 |
|
192 | |||
193 | development_build:!win32-msvc*:{ |
|
193 | development_build:!win32-msvc*:{ | |
194 | chartversion.target = $$PWD/qchartversion_p.h |
|
194 | chartversion.target = $$PWD/qchartversion_p.h | |
195 |
|
195 | |||
196 | unix:{ |
|
196 | unix:{ | |
197 | chartversion.commands = @echo \ |
|
197 | chartversion.commands = @echo \ | |
198 | \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ |
|
198 | \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ | |
199 | $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ |
|
199 | $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ | |
200 | const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ |
|
200 | const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ | |
201 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ |
|
201 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ | |
202 | $${LITERAL_HASH}endif \" \ |
|
202 | $${LITERAL_HASH}endif \" \ | |
203 | > \ |
|
203 | > \ | |
204 | $$chartversion.target; |
|
204 | $$chartversion.target; | |
205 | }else{ |
|
205 | }else{ | |
206 | chartversion.commands = @echo \ |
|
206 | chartversion.commands = @echo \ | |
207 | "const char *buildTime = \"%date%_%time%\" ; \ |
|
207 | "const char *buildTime = \"%date%_%time%\" ; \ | |
208 | const char *gitHead = \"unknown\" ; " \ |
|
208 | const char *gitHead = \"unknown\" ; " \ | |
209 | > \ |
|
209 | > \ | |
210 | $$chartversion.target |
|
210 | $$chartversion.target | |
211 | } |
|
211 | } | |
212 |
|
212 | |||
213 | chartversion.depends = $$HEADERS \ |
|
213 | chartversion.depends = $$HEADERS \ | |
214 | $$SOURCES |
|
214 | $$SOURCES | |
215 |
|
215 | |||
216 | PRE_TARGETDEPS += $$chartversion.target |
|
216 | PRE_TARGETDEPS += $$chartversion.target | |
217 | QMAKE_CLEAN += $$PWD/qchartversion_p.h |
|
217 | QMAKE_CLEAN += $$PWD/qchartversion_p.h | |
218 | QMAKE_EXTRA_TARGETS += chartversion |
|
218 | QMAKE_EXTRA_TARGETS += chartversion | |
219 | } |
|
219 | } | |
220 |
|
220 | |||
221 | ############################### CLEAN ########################################### |
|
221 | ############################### CLEAN ########################################### | |
222 |
|
222 | |||
223 | unix:QMAKE_DISTCLEAN += -r \ |
|
223 | unix:QMAKE_DISTCLEAN += -r \ | |
224 | $$CHART_BUILD_HEADER_DIR \ |
|
224 | $$CHART_BUILD_HEADER_DIR \ | |
225 | $$CHART_BUILD_LIB_DIR |
|
225 | $$CHART_BUILD_LIB_DIR | |
226 | win32:QMAKE_DISTCLEAN += /Q \ |
|
226 | win32:QMAKE_DISTCLEAN += /Q \ | |
227 | $$CHART_BUILD_HEADER_DIR \ |
|
227 | $$CHART_BUILD_HEADER_DIR \ | |
228 | $$CHART_BUILD_LIB_DIR |
|
228 | $$CHART_BUILD_LIB_DIR | |
229 |
|
229 | |||
230 | ############################## COVERAGE ######################################### |
|
230 | ############################## COVERAGE ######################################### | |
231 |
|
231 | |||
232 | unix:coverage:{ |
|
232 | unix:coverage:{ | |
233 |
|
233 | |||
234 | QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage |
|
234 | QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage | |
235 | QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage |
|
235 | QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage | |
236 |
|
236 | |||
237 | LIBS += -lgcov |
|
237 | LIBS += -lgcov | |
238 |
|
238 | |||
239 | QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info |
|
239 | QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info | |
240 | QMAKE_EXTRA_TARGETS += preparecoverage gencoverage |
|
240 | QMAKE_EXTRA_TARGETS += preparecoverage gencoverage | |
241 |
|
241 | |||
242 | preparecoverage.target = prepare_coverage |
|
242 | preparecoverage.target = prepare_coverage | |
243 | preparecoverage.depends = all |
|
243 | preparecoverage.depends = all | |
244 | preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ |
|
244 | preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ | |
245 | lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; |
|
245 | lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; | |
246 |
|
246 | |||
247 | gencoverage.target = gen_coverage |
|
247 | gencoverage.target = gen_coverage | |
248 | gencoverage.depends = all |
|
248 | gencoverage.depends = all | |
249 | gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ |
|
249 | gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ | |
250 | lcov -e ../coverage/base.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/base.info;\ |
|
250 | lcov -e ../coverage/base.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/base.info;\ | |
251 | lcov -e ../coverage/src.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/src.info;\ |
|
251 | lcov -e ../coverage/src.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/src.info;\ | |
252 | lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; |
|
252 | lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; | |
253 | } |
|
253 | } | |
254 |
|
254 |
General Comments 0
You need to be logged in to leave comments.
Login now