@@ -0,0 +1,28 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2012 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #ifndef MACROINCLUDE_H_ | |
|
22 | #define MACROINCLUDE_H_ | |
|
23 | ||
|
24 | // this is needed by the designer plugin. | |
|
25 | ||
|
26 | QTCOMMERCIALCHART_USE_NAMESPACE | |
|
27 | ||
|
28 | #endif /* MACROINCLUDE_H_ */ |
@@ -1,78 +1,88 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2012 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #include "qchartsplugin.h" |
|
22 | 22 | #include "qchartview.h" |
|
23 | 23 | #include <QtPlugin> |
|
24 | 24 | |
|
25 | 25 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
26 | 26 | |
|
27 | 27 | QChartsPlugin::QChartsPlugin(QObject *parent) : |
|
28 | 28 | QObject(parent) |
|
29 | 29 | { |
|
30 | 30 | // TODO Auto-generated constructor stub |
|
31 | 31 | } |
|
32 | 32 | |
|
33 | 33 | QChartsPlugin::~QChartsPlugin() |
|
34 | 34 | { |
|
35 | 35 | // TODO Auto-generated destructor stub |
|
36 | 36 | } |
|
37 | 37 | |
|
38 | 38 | QString QChartsPlugin::name() const |
|
39 | 39 | { |
|
40 | 40 | return "QChartView"; |
|
41 | 41 | } |
|
42 | 42 | |
|
43 | 43 | QString QChartsPlugin::includeFile() const |
|
44 | 44 | { |
|
45 | return "<qchartview.h>"; | |
|
45 | #ifdef linux | |
|
46 | QString myNewLine = "\n"; | |
|
47 | #endif | |
|
48 | #ifdef WIN32 | |
|
49 | QString myNewLine = "\n\r"; | |
|
50 | #endif | |
|
51 | #ifdef __APPLE__ | |
|
52 | QString myNewLine = "\n"; | |
|
53 | #endif | |
|
54 | ||
|
55 | return "<qchartview.h>" + myNewLine + "#include <chartsnamespace.h>"; | |
|
46 | 56 | } |
|
47 | 57 | |
|
48 | 58 | QString QChartsPlugin::group() const |
|
49 | 59 | { |
|
50 | 60 | return tr("QCharts Widgets"); |
|
51 | 61 | } |
|
52 | 62 | |
|
53 | 63 | QIcon QChartsPlugin::icon() const |
|
54 | 64 | { |
|
55 | 65 | return QIcon(":/images/qcharts.png"); |
|
56 | 66 | } |
|
57 | 67 | |
|
58 | 68 | QString QChartsPlugin::toolTip() const |
|
59 | 69 | { |
|
60 | 70 | return tr("An qcharts view widget"); |
|
61 | 71 | } |
|
62 | 72 | |
|
63 | 73 | QString QChartsPlugin::whatsThis() const |
|
64 | 74 | { |
|
65 | 75 | return tr("This widget is presents QChartView widget"); |
|
66 | 76 | } |
|
67 | 77 | |
|
68 | 78 | bool QChartsPlugin::isContainer() const |
|
69 | 79 | { |
|
70 | 80 | return false; |
|
71 | 81 | } |
|
72 | 82 | |
|
73 | 83 | QWidget* QChartsPlugin::createWidget(QWidget *parent) |
|
74 | 84 | { |
|
75 | 85 | return new QChartView(new QChart(), parent); |
|
76 | 86 | } |
|
77 | 87 | |
|
78 | 88 | Q_EXPORT_PLUGIN2(qtcommercialchart, QChartsPlugin) |
@@ -1,251 +1,253 | |||
|
1 | 1 | !include( ../config.pri ):error( "Couldn't find the config.pri file!" ) |
|
2 | 2 | |
|
3 | 3 | ############################# BUILD CONFIG ###################################### |
|
4 | 4 | |
|
5 | 5 | TARGET = $$LIBRARY_NAME |
|
6 | 6 | DESTDIR = $$CHART_BUILD_LIB_DIR |
|
7 | 7 | TEMPLATE = lib |
|
8 | 8 | QT = core gui |
|
9 | 9 | DEFINES += QTCOMMERCIALCHART_LIBRARY |
|
10 | 10 | win32:CONFIG += create_prl |
|
11 | 11 | # treat warnings as errors |
|
12 | 12 | win32-msvc*: { |
|
13 | 13 | QMAKE_CXXFLAGS += /WX |
|
14 | 14 | } else { |
|
15 | 15 | QMAKE_CXXFLAGS += -Werror |
|
16 | 16 | } |
|
17 | 17 | |
|
18 | 18 | unix:{ |
|
19 | 19 | QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden |
|
20 | 20 | } |
|
21 | 21 | |
|
22 | 22 | ############################# DEPEDENCES ######################################## |
|
23 | 23 | |
|
24 | 24 | win32-msvc*: LIBS += User32.lib |
|
25 | 25 | LIBS -= -l$$LIBRARY_NAME |
|
26 | 26 | INCLUDEPATH += ../include . |
|
27 | 27 | |
|
28 | 28 | ############################# SOURCES ########################################## |
|
29 | 29 | |
|
30 | 30 | SOURCES += \ |
|
31 | 31 | $$PWD/chartdataset.cpp \ |
|
32 | 32 | $$PWD/chartpresenter.cpp \ |
|
33 | 33 | $$PWD/charttheme.cpp \ |
|
34 | 34 | $$PWD/domain.cpp \ |
|
35 | 35 | $$PWD/qchart.cpp \ |
|
36 | 36 | $$PWD/qchartview.cpp \ |
|
37 | 37 | $$PWD/qabstractseries.cpp \ |
|
38 | 38 | $$PWD/chartbackground.cpp \ |
|
39 | 39 | $$PWD/chartelement.cpp \ |
|
40 | 40 | $$PWD/scroller.cpp \ |
|
41 | 41 | $$PWD/chartlayout.cpp |
|
42 | 42 | PRIVATE_HEADERS += \ |
|
43 | 43 | $$PWD/chartdataset_p.h \ |
|
44 | 44 | $$PWD/chartitem_p.h \ |
|
45 | 45 | $$PWD/chartpresenter_p.h \ |
|
46 | 46 | $$PWD/charttheme_p.h \ |
|
47 | 47 | $$PWD/domain_p.h \ |
|
48 | 48 | $$PWD/chartbackground_p.h \ |
|
49 | 49 | $$PWD/chartelement_p.h \ |
|
50 | 50 | $$PWD/chartconfig_p.h \ |
|
51 | 51 | $$PWD/qchart_p.h \ |
|
52 | 52 | $$PWD/qchartview_p.h \ |
|
53 | 53 | $$PWD/scroller_p.h \ |
|
54 | 54 | $$PWD/qabstractseries_p.h \ |
|
55 | 55 | $$PWD/chartlayout_p.h |
|
56 | ||
|
56 | 57 | PUBLIC_HEADERS += \ |
|
57 | 58 | $$PWD/qchart.h \ |
|
58 | 59 | $$PWD/qchartglobal.h \ |
|
59 | 60 | $$PWD/qabstractseries.h \ |
|
60 | $$PWD/qchartview.h | |
|
61 | $$PWD/qchartview.h \ | |
|
62 | $$PWD/chartsnamespace.h | |
|
61 | 63 | |
|
62 | 64 | include(animations/animations.pri) |
|
63 | 65 | include(areachart/areachart.pri) |
|
64 | 66 | include(axis/axis.pri) |
|
65 | 67 | include(barchart/barchart.pri) |
|
66 | 68 | include(legend/legend.pri) |
|
67 | 69 | include(linechart/linechart.pri) |
|
68 | 70 | include(piechart/piechart.pri) |
|
69 | 71 | include(scatterchart/scatter.pri) |
|
70 | 72 | include(splinechart/splinechart.pri) |
|
71 | 73 | include(themes/themes.pri) |
|
72 | 74 | include(xychart/xychart.pri) |
|
73 | 75 | |
|
74 | 76 | HEADERS += $$PUBLIC_HEADERS |
|
75 | 77 | HEADERS += $$PRIVATE_HEADERS |
|
76 | 78 | HEADERS += $$THEMES |
|
77 | 79 | |
|
78 | 80 | ############################# BUILD PATH ########################################## |
|
79 | 81 | |
|
80 | 82 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
81 | 83 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
82 | 84 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
83 | 85 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
84 | 86 | |
|
85 | 87 | ############################# PUBLIC HEADERS GENERTOR ########################################## |
|
86 | 88 | |
|
87 | 89 | #this is very primitive and lame parser , TODO: make perl script insted |
|
88 | 90 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) |
|
89 | 91 | { |
|
90 | 92 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) |
|
91 | 93 | win32:{ |
|
92 | 94 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
93 | 95 | }else{ |
|
94 | 96 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
95 | 97 | } |
|
96 | 98 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal |
|
97 | 99 | system($$command) |
|
98 | 100 | } |
|
99 | 101 | |
|
100 | 102 | for(file, PUBLIC_HEADERS) { |
|
101 | 103 | name = $$split(file,'/') |
|
102 | 104 | name = $$last(name) |
|
103 | 105 | class = "$$cat($$file)" |
|
104 | 106 | class = $$find(class,class) |
|
105 | 107 | !isEmpty(class){ |
|
106 | 108 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) |
|
107 | 109 | class = $$member(class,1) |
|
108 | 110 | class = $$split(class,' ') |
|
109 | 111 | class = $$replace(class,' ','') |
|
110 | 112 | class = $$member(class,0) |
|
111 | 113 | win32:{ |
|
112 | 114 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
113 | 115 | }else{ |
|
114 | 116 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
115 | 117 | } |
|
116 | 118 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class |
|
117 | 119 | system($$command) |
|
118 | 120 | } |
|
119 | 121 | } |
|
120 | 122 | |
|
121 | 123 | ############################# INSTALLERS ########################################## |
|
122 | 124 | |
|
123 | 125 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
124 | 126 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS |
|
125 | 127 | INSTALLS += public_headers |
|
126 | 128 | |
|
127 | 129 | install_build_public_headers.name = build_public_headers |
|
128 | 130 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
129 | 131 | install_build_public_headers.input = PUBLIC_HEADERS |
|
130 | 132 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
131 | 133 | ${QMAKE_FILE_NAME} \ |
|
132 | 134 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
133 | 135 | install_build_public_headers.CONFIG += target_predeps \ |
|
134 | 136 | no_link |
|
135 | 137 | |
|
136 | 138 | install_build_private_headers.name = buld_private_headers |
|
137 | 139 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
138 | 140 | install_build_private_headers.input = PRIVATE_HEADERS |
|
139 | 141 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
140 | 142 | ${QMAKE_FILE_NAME} \ |
|
141 | 143 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
142 | 144 | install_build_private_headers.CONFIG += target_predeps \ |
|
143 | 145 | no_link |
|
144 | 146 | |
|
145 | 147 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
146 | 148 | install_build_private_headers \ |
|
147 | 149 | |
|
148 | 150 | win32:{ |
|
149 | 151 | bintarget.CONFIG += no_check_exist |
|
150 | 152 | !staticlib: { |
|
151 | 153 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll |
|
152 | 154 | } |
|
153 | 155 | win32-msvc*:CONFIG(debug, debug|release): { |
|
154 | 156 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb |
|
155 | 157 | } |
|
156 | 158 | bintarget.path = $$[QT_INSTALL_BINS] |
|
157 | 159 | |
|
158 | 160 | libtarget.CONFIG += no_check_exist |
|
159 | 161 | libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl |
|
160 | 162 | win32-msvc*: { |
|
161 | 163 | libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib |
|
162 | 164 | } else { |
|
163 | 165 | libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a |
|
164 | 166 | } |
|
165 | 167 | libtarget.path = $$[QT_INSTALL_LIBS] |
|
166 | 168 | |
|
167 | 169 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR |
|
168 | 170 | INSTALLS += bintarget libtarget |
|
169 | 171 | }else{ |
|
170 | 172 | target.path=$$[QT_INSTALL_LIBS] |
|
171 | 173 | INSTALLS += target |
|
172 | 174 | } |
|
173 | 175 | |
|
174 | 176 | mac: !staticlib: { |
|
175 | 177 | # Update the name (id) of the library on OSX to point to the lib path |
|
176 | 178 | MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib" |
|
177 | 179 | QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME" |
|
178 | 180 | |
|
179 | 181 | # Update the name (id) of the installed library on OSX to point to the installation path |
|
180 | 182 | postinstall.path = $$[QT_INSTALL_LIBS] |
|
181 | 183 | postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME" |
|
182 | 184 | INSTALLS += postinstall |
|
183 | 185 | } |
|
184 | 186 | |
|
185 | 187 | ################################ DEVELOPMENT BUILD ########################################## |
|
186 | 188 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. |
|
187 | 189 | # This is the case at least with shadow builds. |
|
188 | 190 | # http://qt-project.org/wiki/jom |
|
189 | 191 | |
|
190 | 192 | development_build:!win32-msvc*:{ |
|
191 | 193 | chartversion.target = $$PWD/qchartversion_p.h |
|
192 | 194 | |
|
193 | 195 | unix:{ |
|
194 | 196 | chartversion.commands = @echo \ |
|
195 | 197 | \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ |
|
196 | 198 | $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ |
|
197 | 199 | const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ |
|
198 | 200 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ |
|
199 | 201 | $${LITERAL_HASH}endif \" \ |
|
200 | 202 | > \ |
|
201 | 203 | $$chartversion.target; |
|
202 | 204 | }else{ |
|
203 | 205 | chartversion.commands = @echo \ |
|
204 | 206 | "const char *buildTime = \"%date%_%time%\" ; \ |
|
205 | 207 | const char *gitHead = \"unknown\" ; " \ |
|
206 | 208 | > \ |
|
207 | 209 | $$chartversion.target |
|
208 | 210 | } |
|
209 | 211 | |
|
210 | 212 | chartversion.depends = $$HEADERS \ |
|
211 | 213 | $$SOURCES |
|
212 | 214 | |
|
213 | 215 | PRE_TARGETDEPS += $$chartversion.target |
|
214 | 216 | QMAKE_CLEAN += $$PWD/qchartversion_p.h |
|
215 | 217 | QMAKE_EXTRA_TARGETS += chartversion |
|
216 | 218 | } |
|
217 | 219 | |
|
218 | 220 | ############################### CLEAN ########################################### |
|
219 | 221 | |
|
220 | 222 | unix:QMAKE_DISTCLEAN += -r \ |
|
221 | 223 | $$CHART_BUILD_HEADER_DIR \ |
|
222 | 224 | $$CHART_BUILD_LIB_DIR |
|
223 | 225 | win32:QMAKE_DISTCLEAN += /Q \ |
|
224 | 226 | $$CHART_BUILD_HEADER_DIR \ |
|
225 | 227 | $$CHART_BUILD_LIB_DIR |
|
226 | 228 | |
|
227 | 229 | ############################## COVERAGE ######################################### |
|
228 | 230 | |
|
229 | 231 | unix:coverage:{ |
|
230 | 232 | |
|
231 | 233 | QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage |
|
232 | 234 | QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage |
|
233 | 235 | |
|
234 | 236 | LIBS += -lgcov |
|
235 | 237 | |
|
236 | 238 | QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info |
|
237 | 239 | QMAKE_EXTRA_TARGETS += preparecoverage gencoverage |
|
238 | 240 | |
|
239 | 241 | preparecoverage.target = prepare_coverage |
|
240 | 242 | preparecoverage.depends = all |
|
241 | 243 | preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ |
|
242 | 244 | lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; |
|
243 | 245 | |
|
244 | 246 | gencoverage.target = gen_coverage |
|
245 | 247 | gencoverage.depends = all |
|
246 | 248 | gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ |
|
247 | 249 | 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;\ |
|
248 | 250 | 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;\ |
|
249 | 251 | lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; |
|
250 | 252 | } |
|
251 | 253 |
General Comments 0
You need to be logged in to leave comments.
Login now