@@ -1,4 +1,4 | |||||
1 | load(qt_build_config) |
|
1 | load(qt_build_config) | |
2 | CONFIG += qt_example_installs |
|
2 | CONFIG += qt_example_installs | |
3 |
|
3 | |||
4 |
MODULE_VERSION= |
|
4 | MODULE_VERSION=5.7.0 |
@@ -1,78 +1,78 | |||||
1 | --------------- |
|
1 | --------------- | |
2 |
Qt Charts |
|
2 | Qt Charts 5.7.0 | |
3 | --------------- |
|
3 | --------------- | |
4 |
|
4 | |||
5 | Qt Charts module provides a set of easy to use chart components. It uses |
|
5 | Qt Charts module provides a set of easy to use chart components. It uses | |
6 | the Qt Graphics View Framework, therefore charts can be easily integrated |
|
6 | the Qt Graphics View Framework, therefore charts can be easily integrated | |
7 | to modern user interfaces. |
|
7 | to modern user interfaces. | |
8 |
|
8 | |||
9 | System Requirements |
|
9 | System Requirements | |
10 | =================== |
|
10 | =================== | |
11 |
|
11 | |||
12 | - Qt 5.4 or newer |
|
12 | - Qt 5.4 or newer | |
13 | - For QML applications QtQuick 2 is required |
|
13 | - For QML applications QtQuick 2 is required | |
14 | - Manipulating Qt Charts graphs with QML Designer requires Qt Creator 3.3 or newer |
|
14 | - Manipulating Qt Charts graphs with QML Designer requires Qt Creator 3.3 or newer | |
15 |
|
15 | |||
16 | Building |
|
16 | Building | |
17 | ======== |
|
17 | ======== | |
18 |
|
18 | |||
19 | Configure the project with qmake: |
|
19 | Configure the project with qmake: | |
20 | qmake |
|
20 | qmake | |
21 |
|
21 | |||
22 | After running qmake, build the project with make: |
|
22 | After running qmake, build the project with make: | |
23 | (Linux) make |
|
23 | (Linux) make | |
24 | (Windows with MinGw) mingw32-make |
|
24 | (Windows with MinGw) mingw32-make | |
25 | (Windows with Visual Studio) nmake |
|
25 | (Windows with Visual Studio) nmake | |
26 | (OS X) make |
|
26 | (OS X) make | |
27 |
|
27 | |||
28 | The above generates the default makefiles for your configuration, which is typically |
|
28 | The above generates the default makefiles for your configuration, which is typically | |
29 | the release build if you are using precompiled binary Qt distribution. To build both |
|
29 | the release build if you are using precompiled binary Qt distribution. To build both | |
30 | debug and release, or one specifically, use one of the following qmake lines instead. |
|
30 | debug and release, or one specifically, use one of the following qmake lines instead. | |
31 |
|
31 | |||
32 | For debug builds: |
|
32 | For debug builds: | |
33 | qmake CONFIG+=debug |
|
33 | qmake CONFIG+=debug | |
34 | make |
|
34 | make | |
35 | or |
|
35 | or | |
36 | qmake CONFIG+=debug_and_release |
|
36 | qmake CONFIG+=debug_and_release | |
37 | make debug |
|
37 | make debug | |
38 |
|
38 | |||
39 | For release builds: |
|
39 | For release builds: | |
40 | qmake CONFIG+=release |
|
40 | qmake CONFIG+=release | |
41 | make |
|
41 | make | |
42 | or |
|
42 | or | |
43 | qmake CONFIG+=debug_and_release |
|
43 | qmake CONFIG+=debug_and_release | |
44 | make release |
|
44 | make release | |
45 |
|
45 | |||
46 | For both builds (Windows/OS X only): |
|
46 | For both builds (Windows/OS X only): | |
47 | qmake CONFIG+="debug_and_release build_all" |
|
47 | qmake CONFIG+="debug_and_release build_all" | |
48 | make |
|
48 | make | |
49 |
|
49 | |||
50 | After building, install the module to your Qt directory: |
|
50 | After building, install the module to your Qt directory: | |
51 | make install |
|
51 | make install | |
52 |
|
52 | |||
53 | If you want to uninstall the module: |
|
53 | If you want to uninstall the module: | |
54 | make uninstall |
|
54 | make uninstall | |
55 |
|
55 | |||
56 | Building as a statically linked library |
|
56 | Building as a statically linked library | |
57 | ======================================= |
|
57 | ======================================= | |
58 |
|
58 | |||
59 | The same as above applies, you will just have to add static to the CONFIG: |
|
59 | The same as above applies, you will just have to add static to the CONFIG: | |
60 | qmake CONFIG+=static |
|
60 | qmake CONFIG+=static | |
61 |
|
61 | |||
62 | Documentation |
|
62 | Documentation | |
63 | ============= |
|
63 | ============= | |
64 |
|
64 | |||
65 | The documentation can be generated with: |
|
65 | The documentation can be generated with: | |
66 | make docs |
|
66 | make docs | |
67 |
|
67 | |||
68 | The documentation is generated into the doc folder under the build folder. |
|
68 | The documentation is generated into the doc folder under the build folder. | |
69 | Both Qt Assistant (qtcharts.qch) and in HTML format (qtcharts subfolder) |
|
69 | Both Qt Assistant (qtcharts.qch) and in HTML format (qtcharts subfolder) | |
70 | documentation is generated. |
|
70 | documentation is generated. | |
71 |
|
71 | |||
72 | Please refer to the generated documentation for more information: |
|
72 | Please refer to the generated documentation for more information: | |
73 | doc/qtcharts/index.html |
|
73 | doc/qtcharts/index.html | |
74 |
|
74 | |||
75 | Known issues |
|
75 | Known issues | |
76 | ============ |
|
76 | ============ | |
77 |
|
77 | |||
78 | - Zooming too far or too close may eventually freeze the zooming and scrolling. |
|
78 | - Zooming too far or too close may eventually freeze the zooming and scrolling. |
@@ -1,72 +1,72 | |||||
1 | include($QT_INSTALL_DOCS/global/macros.qdocconf) |
|
1 | include($QT_INSTALL_DOCS/global/macros.qdocconf) | |
2 | include($QT_INSTALL_DOCS/global/qt-cpp-defines.qdocconf) |
|
2 | include($QT_INSTALL_DOCS/global/qt-cpp-defines.qdocconf) | |
3 | include($QT_INSTALL_DOCS/global/compat.qdocconf) |
|
3 | include($QT_INSTALL_DOCS/global/compat.qdocconf) | |
4 | include($QT_INSTALL_DOCS/global/fileextensions.qdocconf) |
|
4 | include($QT_INSTALL_DOCS/global/fileextensions.qdocconf) | |
5 | include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf) |
|
5 | include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf) | |
6 |
|
6 | |||
7 | project = QtCharts |
|
7 | project = QtCharts | |
8 | description = Qt Charts Reference Documentation |
|
8 | description = Qt Charts Reference Documentation | |
9 | version = 2.1.0 |
|
9 | version = $QT_VERSION | |
10 |
|
10 | |||
11 | sourcedirs += .. \ |
|
11 | sourcedirs += .. \ | |
12 | ../../chartsqml2 |
|
12 | ../../chartsqml2 | |
13 | headerdirs += .. \ |
|
13 | headerdirs += .. \ | |
14 | ../../chartsqml2 |
|
14 | ../../chartsqml2 | |
15 | exampledirs += ../../../examples/charts \ |
|
15 | exampledirs += ../../../examples/charts \ | |
16 | snippets |
|
16 | snippets | |
17 | imagedirs += images |
|
17 | imagedirs += images | |
18 | examplesinstallpath = charts |
|
18 | examplesinstallpath = charts | |
19 |
|
19 | |||
20 | sources.fileextensions = "*.cpp *.qdoc" |
|
20 | sources.fileextensions = "*.cpp *.qdoc" | |
21 |
|
21 | |||
22 | indexes += $QT_INSTALL_DOCS/qtcore/qtcore.index \ |
|
22 | indexes += $QT_INSTALL_DOCS/qtcore/qtcore.index \ | |
23 | $QT_INSTALL_DOCS/qtgui/qtgui.index \ |
|
23 | $QT_INSTALL_DOCS/qtgui/qtgui.index \ | |
24 | $QT_INSTALL_DOCS/qtqml/qtqml.index \ |
|
24 | $QT_INSTALL_DOCS/qtqml/qtqml.index \ | |
25 | $QT_INSTALL_DOCS/qtquick/qtquick.index \ |
|
25 | $QT_INSTALL_DOCS/qtquick/qtquick.index \ | |
26 | $QT_INSTALL_DOCS/qtmultimedia/qtmultimedia.index |
|
26 | $QT_INSTALL_DOCS/qtmultimedia/qtmultimedia.index | |
27 |
|
27 | |||
28 | Cpp.ignoretokens = Q_INVOKABLE \ |
|
28 | Cpp.ignoretokens = Q_INVOKABLE \ | |
29 | QT_CHARTS_EXPORT \ |
|
29 | QT_CHARTS_EXPORT \ | |
30 | QT_CHARTS_END_NAMESPACE \ |
|
30 | QT_CHARTS_END_NAMESPACE \ | |
31 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | QT_CHARTS_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | qhp.projects = QtCharts |
|
33 | qhp.projects = QtCharts | |
34 | qhp.QtCharts.file = qtcharts.qhp |
|
34 | qhp.QtCharts.file = qtcharts.qhp | |
35 |
qhp.QtCharts.namespace = com.digia.qtcharts. |
|
35 | qhp.QtCharts.namespace = com.digia.qtcharts.$QT_VERSION_TAG | |
36 | qhp.QtCharts.virtualFolder = qtcharts |
|
36 | qhp.QtCharts.virtualFolder = qtcharts | |
37 | qhp.QtCharts.indexTitle = Qt Charts |
|
37 | qhp.QtCharts.indexTitle = Qt Charts | |
38 | qhp.QtCharts.indexRoot = |
|
38 | qhp.QtCharts.indexRoot = | |
39 |
|
39 | |||
40 |
qhp.QtCharts.filterAttributes = qtcharts |
|
40 | qhp.QtCharts.filterAttributes = qtcharts $QT_VERSION qtrefdoc | |
41 |
qhp.QtCharts.customFilters.Qt.name = QtCharts |
|
41 | qhp.QtCharts.customFilters.Qt.name = QtCharts $QT_VERSION | |
42 |
qhp.QtCharts.customFilters.Qt.filterAttributes = qtcharts |
|
42 | qhp.QtCharts.customFilters.Qt.filterAttributes = qtcharts $QT_VERSION | |
43 |
|
43 | |||
44 | qhp.QtCharts.subprojects = gettingstarted classes types examples |
|
44 | qhp.QtCharts.subprojects = gettingstarted classes types examples | |
45 |
|
45 | |||
46 | qhp.QtCharts.subprojects.gettingstarted.title = Getting Started |
|
46 | qhp.QtCharts.subprojects.gettingstarted.title = Getting Started | |
47 | qhp.QtCharts.subprojects.gettingstarted.indexTitle = Qt Charts Getting Started |
|
47 | qhp.QtCharts.subprojects.gettingstarted.indexTitle = Qt Charts Getting Started | |
48 | qhp.QtCharts.subprojects.gettingstarted.selectors = fake:page |
|
48 | qhp.QtCharts.subprojects.gettingstarted.selectors = fake:page | |
49 | qhp.QtCharts.subprojects.gettingstarted.sortPages = true |
|
49 | qhp.QtCharts.subprojects.gettingstarted.sortPages = true | |
50 |
|
50 | |||
51 | qhp.QtCharts.subprojects.classes.title = C++ Classes |
|
51 | qhp.QtCharts.subprojects.classes.title = C++ Classes | |
52 | qhp.QtCharts.subprojects.classes.indexTitle = Qt Charts C++ Classes |
|
52 | qhp.QtCharts.subprojects.classes.indexTitle = Qt Charts C++ Classes | |
53 | qhp.QtCharts.subprojects.classes.selectors = class |
|
53 | qhp.QtCharts.subprojects.classes.selectors = class | |
54 | qhp.QtCharts.subprojects.classes.sortPages = true |
|
54 | qhp.QtCharts.subprojects.classes.sortPages = true | |
55 |
|
55 | |||
56 | qhp.QtCharts.subprojects.types.title = QML Types |
|
56 | qhp.QtCharts.subprojects.types.title = QML Types | |
57 | qhp.QtCharts.subprojects.types.indexTitle = Qt Charts QML Types |
|
57 | qhp.QtCharts.subprojects.types.indexTitle = Qt Charts QML Types | |
58 | qhp.QtCharts.subprojects.types.selectors = qmlclass |
|
58 | qhp.QtCharts.subprojects.types.selectors = qmlclass | |
59 | qhp.QtCharts.subprojects.types.sortPages = true |
|
59 | qhp.QtCharts.subprojects.types.sortPages = true | |
60 |
|
60 | |||
61 | qhp.QtCharts.subprojects.examples.title = Examples |
|
61 | qhp.QtCharts.subprojects.examples.title = Examples | |
62 | qhp.QtCharts.subprojects.examples.indexTitle = Qt Charts Examples |
|
62 | qhp.QtCharts.subprojects.examples.indexTitle = Qt Charts Examples | |
63 | qhp.QtCharts.subprojects.examples.selectors = fake:example |
|
63 | qhp.QtCharts.subprojects.examples.selectors = fake:example | |
64 | qhp.QtCharts.subprojects.examples.sortPages = true |
|
64 | qhp.QtCharts.subprojects.examples.sortPages = true | |
65 |
|
65 | |||
66 | navigation.landingpage = Qt Charts |
|
66 | navigation.landingpage = Qt Charts | |
67 | navigation.cppclassespage = Qt Charts C++ Classes |
|
67 | navigation.cppclassespage = Qt Charts C++ Classes | |
68 | navigation.qmltypespage = Qt Charts QML Types |
|
68 | navigation.qmltypespage = Qt Charts QML Types | |
69 |
|
69 | |||
70 | depends = qtwidgets |
|
70 | depends = qtwidgets | |
71 |
|
71 | |||
72 | buildversion = Qt Charts $QT_VERSION Reference Documentation |
|
72 | buildversion = Qt Charts $QT_VERSION Reference Documentation |
@@ -1,209 +1,209 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
|
3 | ** Copyright (C) 2016 The Qt Company Ltd. | |
4 | ** Contact: https://www.qt.io/licensing/ |
|
4 | ** Contact: https://www.qt.io/licensing/ | |
5 | ** |
|
5 | ** | |
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. |
|
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. | |
7 | ** |
|
7 | ** | |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
|
8 | ** $QT_BEGIN_LICENSE:GPL$ | |
9 | ** Commercial License Usage |
|
9 | ** Commercial License Usage | |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
|
10 | ** Licensees holding valid commercial Qt licenses may use this file in | |
11 | ** accordance with the commercial license agreement provided with the |
|
11 | ** accordance with the 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 The Qt Company. For licensing terms |
|
13 | ** a written agreement between you and The Qt Company. For licensing terms | |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
|
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
|
15 | ** information use the contact form at https://www.qt.io/contact-us. | |
16 | ** |
|
16 | ** | |
17 | ** GNU General Public License Usage |
|
17 | ** GNU General Public License Usage | |
18 | ** Alternatively, this file may be used under the terms of the GNU |
|
18 | ** Alternatively, this file may be used under the terms of the GNU | |
19 | ** General Public License version 3 or (at your option) any later version |
|
19 | ** General Public License version 3 or (at your option) any later version | |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
|
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by | |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
|
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 | |
22 | ** included in the packaging of this file. Please review the following |
|
22 | ** included in the packaging of this file. Please review the following | |
23 | ** information to ensure the GNU General Public License requirements will |
|
23 | ** information to ensure the GNU General Public License requirements will | |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
|
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. | |
25 | ** |
|
25 | ** | |
26 | ** $QT_END_LICENSE$ |
|
26 | ** $QT_END_LICENSE$ | |
27 | ** |
|
27 | ** | |
28 | ****************************************************************************/ |
|
28 | ****************************************************************************/ | |
29 |
|
29 | |||
30 | /*! |
|
30 | /*! | |
31 | \module Qt Charts |
|
31 | \module Qt Charts | |
32 | \title Qt Charts C++ Classes |
|
32 | \title Qt Charts C++ Classes | |
33 | \ingroup modules |
|
33 | \ingroup modules | |
34 |
|
34 | |||
35 | \brief C++ classes for the Qt Charts API. |
|
35 | \brief C++ classes for the Qt Charts API. | |
36 |
|
36 | |||
37 | Charts API is built on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using the QChart class. However |
|
37 | Charts API is built on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using the QChart class. However | |
38 | there is also the convenience class QChartView, which is QWidget based. These enable us to quickly use Qt Charts as a normal Qt widget. |
|
38 | there is also the convenience class QChartView, which is QWidget based. These enable us to quickly use Qt Charts as a normal Qt widget. | |
39 |
|
39 | |||
40 | Each chart type is represented by the QAbstractSeries derived class. To create charts, the users have to use an instance of the related |
|
40 | Each chart type is represented by the QAbstractSeries derived class. To create charts, the users have to use an instance of the related | |
41 | series class and add it to a QChart instance. |
|
41 | series class and add it to a QChart instance. | |
42 | \code |
|
42 | \code | |
43 | QLineSeries* series = new QLineSeries(); |
|
43 | QLineSeries* series = new QLineSeries(); | |
44 | series->add(0, 6); |
|
44 | series->add(0, 6); | |
45 | series->add(2, 4); |
|
45 | series->add(2, 4); | |
46 | ... |
|
46 | ... | |
47 | chartView->chart()->addSeries(series); |
|
47 | chartView->chart()->addSeries(series); | |
48 | chartView->chart()->createDefaultAxes(); |
|
48 | chartView->chart()->createDefaultAxes(); | |
49 | \endcode |
|
49 | \endcode | |
50 | */ |
|
50 | */ | |
51 |
|
51 | |||
52 | /*! |
|
52 | /*! | |
53 |
\qmlmodule QtCharts 2. |
|
53 | \qmlmodule QtCharts 2.1 | |
54 | \title Qt Charts QML Types |
|
54 | \title Qt Charts QML Types | |
55 | \ingroup qmlmodules |
|
55 | \ingroup qmlmodules | |
56 |
|
56 | |||
57 | \brief QML types for the Qt Charts API. |
|
57 | \brief QML types for the Qt Charts API. | |
58 |
|
58 | |||
59 | The Qt Charts QML API is an intuitive and simple way to show charts in your QML |
|
59 | The Qt Charts QML API is an intuitive and simple way to show charts in your QML | |
60 | applications. |
|
60 | applications. | |
61 |
|
61 | |||
62 | Use the following QML to create a simple pie chart: |
|
62 | Use the following QML to create a simple pie chart: | |
63 | \image examples_qmlpiechart.png |
|
63 | \image examples_qmlpiechart.png | |
64 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 1 |
|
64 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 1 | |
65 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 2 |
|
65 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 2 | |
66 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 3 |
|
66 | \snippet qmlpiechart/qml/qmlpiechart/main.qml 3 | |
67 |
|
67 | |||
68 | \note Since Qt Creator 3.0 the project created with Qt Quick Application wizard based on |
|
68 | \note Since Qt Creator 3.0 the project created with Qt Quick Application wizard based on | |
69 | Qt Quick 2 template uses QGuiApplication by default. As Qt Charts utilizes Qt Graphics View |
|
69 | Qt Quick 2 template uses QGuiApplication by default. As Qt Charts utilizes Qt Graphics View | |
70 | Framework for drawing, QApplication must be used. The project created with the wizard is |
|
70 | Framework for drawing, QApplication must be used. The project created with the wizard is | |
71 | usable with Qt Charts after the QGuiApplication is replaced with QApplication. |
|
71 | usable with Qt Charts after the QGuiApplication is replaced with QApplication. | |
72 |
|
72 | |||
73 | \section1 QML Types |
|
73 | \section1 QML Types | |
74 | */ |
|
74 | */ | |
75 |
|
75 | |||
76 | /*! |
|
76 | /*! | |
77 | \group charts_examples |
|
77 | \group charts_examples | |
78 | \ingroup all-examples |
|
78 | \ingroup all-examples | |
79 | \title Qt Charts Examples |
|
79 | \title Qt Charts Examples | |
80 |
|
80 | |||
81 | \brief Examples for the Qt Charts. |
|
81 | \brief Examples for the Qt Charts. | |
82 |
|
82 | |||
83 | For some code examples, see one of the Qt Charts examples: |
|
83 | For some code examples, see one of the Qt Charts examples: | |
84 |
|
84 | |||
85 | \section1 Examples |
|
85 | \section1 Examples | |
86 |
|
86 | |||
87 | \annotatedlist qtcharts_examples |
|
87 | \annotatedlist qtcharts_examples | |
88 | */ |
|
88 | */ | |
89 |
|
89 | |||
90 | /*! |
|
90 | /*! | |
91 | \group qtcharts_getting_started |
|
91 | \group qtcharts_getting_started | |
92 | \title Qt Charts Getting Started |
|
92 | \title Qt Charts Getting Started | |
93 |
|
93 | |||
94 | \section1 Installing the Qt Charts module |
|
94 | \section1 Installing the Qt Charts module | |
95 |
|
95 | |||
96 | Use the \c {Package Manager} in \c {Maintenance Tool} or the \c {Online installer} to install |
|
96 | Use the \c {Package Manager} in \c {Maintenance Tool} or the \c {Online installer} to install | |
97 | the Qt Charts module. The module can be found under \c {Qt Enterprise Add-Ons} in the |
|
97 | the Qt Charts module. The module can be found under \c {Qt Enterprise Add-Ons} in the | |
98 | package manager. |
|
98 | package manager. | |
99 |
|
99 | |||
100 | After installation Qt Charts documentation and examples are available in Qt Creator. |
|
100 | After installation Qt Charts documentation and examples are available in Qt Creator. | |
101 | Examples can be found on the examples page of Qt Creator by selecting the Qt Charts |
|
101 | Examples can be found on the examples page of Qt Creator by selecting the Qt Charts | |
102 | component from the drop-down menu. |
|
102 | component from the drop-down menu. | |
103 |
|
103 | |||
104 | The source code is installed into the QtCharts folder under EnterpriseAddOns. |
|
104 | The source code is installed into the QtCharts folder under EnterpriseAddOns. | |
105 |
|
105 | |||
106 | \section1 Building Qt Charts |
|
106 | \section1 Building Qt Charts | |
107 |
|
107 | |||
108 | To build the Qt Charts module from source code yourself, set up a command prompt with |
|
108 | To build the Qt Charts module from source code yourself, set up a command prompt with | |
109 | an environment for building Qt applications, navigate to the directory containing |
|
109 | an environment for building Qt applications, navigate to the directory containing | |
110 | \c {qtcharts.pro}, and configure the project with qmake: |
|
110 | \c {qtcharts.pro}, and configure the project with qmake: | |
111 | \code |
|
111 | \code | |
112 | qmake |
|
112 | qmake | |
113 | \endcode |
|
113 | \endcode | |
114 |
|
114 | |||
115 | qmake should be run from the folder where Qt has been installed. For example, |
|
115 | qmake should be run from the folder where Qt has been installed. For example, | |
116 | if Qt is built with -prefix /opt/MyXCompiledQt, then qmake should be run |
|
116 | if Qt is built with -prefix /opt/MyXCompiledQt, then qmake should be run | |
117 | from /opt/MyXCompiledQt/bin/qmake. |
|
117 | from /opt/MyXCompiledQt/bin/qmake. | |
118 |
|
118 | |||
119 | After running qmake, build the project with make: |
|
119 | After running qmake, build the project with make: | |
120 | \table |
|
120 | \table | |
121 | \header |
|
121 | \header | |
122 | \li OS \li Make command |
|
122 | \li OS \li Make command | |
123 | \row |
|
123 | \row | |
124 | \li Linux \li make |
|
124 | \li Linux \li make | |
125 | \row |
|
125 | \row | |
126 | \li Windows (MinGw) \li mingw32-make |
|
126 | \li Windows (MinGw) \li mingw32-make | |
127 | \row |
|
127 | \row | |
128 | \li Windows (MSVC) \li nmake |
|
128 | \li Windows (MSVC) \li nmake | |
129 | \row |
|
129 | \row | |
130 | \li OSX \li make |
|
130 | \li OSX \li make | |
131 | \endtable |
|
131 | \endtable | |
132 |
|
132 | |||
133 | The above generates the default makefiles for your configuration, which is typically |
|
133 | The above generates the default makefiles for your configuration, which is typically | |
134 | the release build if you are using precompiled binary Qt distribution. To build both debug |
|
134 | the release build if you are using precompiled binary Qt distribution. To build both debug | |
135 | and release, or one specifically, use one of the following qmake lines instead. |
|
135 | and release, or one specifically, use one of the following qmake lines instead. | |
136 |
|
136 | |||
137 | For debug builds: |
|
137 | For debug builds: | |
138 | \code |
|
138 | \code | |
139 | qmake CONFIG+=debug |
|
139 | qmake CONFIG+=debug | |
140 | make |
|
140 | make | |
141 | \endcode |
|
141 | \endcode | |
142 | or |
|
142 | or | |
143 | \code |
|
143 | \code | |
144 | qmake CONFIG+=debug_and_release |
|
144 | qmake CONFIG+=debug_and_release | |
145 | make debug |
|
145 | make debug | |
146 | \endcode |
|
146 | \endcode | |
147 |
|
147 | |||
148 | For release builds: |
|
148 | For release builds: | |
149 | \code |
|
149 | \code | |
150 | qmake CONFIG+=release |
|
150 | qmake CONFIG+=release | |
151 | make |
|
151 | make | |
152 | \endcode |
|
152 | \endcode | |
153 | or |
|
153 | or | |
154 | \code |
|
154 | \code | |
155 | qmake CONFIG+=debug_and_release |
|
155 | qmake CONFIG+=debug_and_release | |
156 | make release |
|
156 | make release | |
157 | \endcode |
|
157 | \endcode | |
158 |
|
158 | |||
159 | For both builds (Windows/OS X only): |
|
159 | For both builds (Windows/OS X only): | |
160 | \code |
|
160 | \code | |
161 | qmake CONFIG+="debug_and_release build_all" |
|
161 | qmake CONFIG+="debug_and_release build_all" | |
162 | make |
|
162 | make | |
163 | \endcode |
|
163 | \endcode | |
164 |
|
164 | |||
165 | After building, install the module to your Qt directory: |
|
165 | After building, install the module to your Qt directory: | |
166 | \code |
|
166 | \code | |
167 | make install |
|
167 | make install | |
168 | \endcode |
|
168 | \endcode | |
169 |
|
169 | |||
170 | If you want to uninstall the module: |
|
170 | If you want to uninstall the module: | |
171 | \code |
|
171 | \code | |
172 | make uninstall |
|
172 | make uninstall | |
173 | \endcode |
|
173 | \endcode | |
174 |
|
174 | |||
175 | To build a statically linked version of the Qt Charts module, give the following commands: |
|
175 | To build a statically linked version of the Qt Charts module, give the following commands: | |
176 |
|
176 | |||
177 | \snippet doc_src_qtcharts.cpp 1 |
|
177 | \snippet doc_src_qtcharts.cpp 1 | |
178 |
|
178 | |||
179 | \section1 Running examples |
|
179 | \section1 Running examples | |
180 |
|
180 | |||
181 | Qt Charts examples are found under the \c examples subdirectory. To build and run a single |
|
181 | Qt Charts examples are found under the \c examples subdirectory. To build and run a single | |
182 | example, in this case qmlpolarchart, navigate to the example directory and enter the following |
|
182 | example, in this case qmlpolarchart, navigate to the example directory and enter the following | |
183 | commands: |
|
183 | commands: | |
184 |
|
184 | |||
185 | \snippet doc_src_qtcharts.cpp 2 |
|
185 | \snippet doc_src_qtcharts.cpp 2 | |
186 |
|
186 | |||
187 | \note On some platforms, such as Windows, the executable can be generated under debug or |
|
187 | \note On some platforms, such as Windows, the executable can be generated under debug or | |
188 | release folders, depending on your build. |
|
188 | release folders, depending on your build. | |
189 |
|
189 | |||
190 | \section1 Creating a simple application |
|
190 | \section1 Creating a simple application | |
191 |
|
191 | |||
192 | To create a simple application, start by creating a new Qt Gui Application project in Qt |
|
192 | To create a simple application, start by creating a new Qt Gui Application project in Qt | |
193 | Creator and add this line to the \c .pro file of the project: |
|
193 | Creator and add this line to the \c .pro file of the project: | |
194 |
|
194 | |||
195 | \snippet doc_src_qtcharts.pro 0 |
|
195 | \snippet doc_src_qtcharts.pro 0 | |
196 |
|
196 | |||
197 | In the \c main.cpp file, include the module headers and declare namespace usage: |
|
197 | In the \c main.cpp file, include the module headers and declare namespace usage: | |
198 |
|
198 | |||
199 | \snippet doc_src_qtcharts.cpp 0 |
|
199 | \snippet doc_src_qtcharts.cpp 0 | |
200 |
|
200 | |||
201 | \note Since Qt Creator 3.0 the project created with Qt Quick Application wizard based on |
|
201 | \note Since Qt Creator 3.0 the project created with Qt Quick Application wizard based on | |
202 | Qt Quick 2 template uses QGuiApplication by default. As Qt Charts utilizes Qt Graphics View |
|
202 | Qt Quick 2 template uses QGuiApplication by default. As Qt Charts utilizes Qt Graphics View | |
203 | Framework for drawing, QApplication must be used. The project created with the wizard is |
|
203 | Framework for drawing, QApplication must be used. The project created with the wizard is | |
204 | usable with Qt Charts after the QGuiApplication is replaced with QApplication. |
|
204 | usable with Qt Charts after the QGuiApplication is replaced with QApplication. | |
205 |
|
205 | |||
206 | For further code examples, see one of the Qt Charts examples: |
|
206 | For further code examples, see one of the Qt Charts examples: | |
207 |
|
207 | |||
208 | \annotatedlist qtcharts_examples |
|
208 | \annotatedlist qtcharts_examples | |
209 | */ |
|
209 | */ |
@@ -1,79 +1,79 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
|
3 | ** Copyright (C) 2016 The Qt Company Ltd. | |
4 | ** Contact: https://www.qt.io/licensing/ |
|
4 | ** Contact: https://www.qt.io/licensing/ | |
5 | ** |
|
5 | ** | |
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. |
|
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. | |
7 | ** |
|
7 | ** | |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
|
8 | ** $QT_BEGIN_LICENSE:GPL$ | |
9 | ** Commercial License Usage |
|
9 | ** Commercial License Usage | |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
|
10 | ** Licensees holding valid commercial Qt licenses may use this file in | |
11 | ** accordance with the commercial license agreement provided with the |
|
11 | ** accordance with the 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 The Qt Company. For licensing terms |
|
13 | ** a written agreement between you and The Qt Company. For licensing terms | |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
|
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
|
15 | ** information use the contact form at https://www.qt.io/contact-us. | |
16 | ** |
|
16 | ** | |
17 | ** GNU General Public License Usage |
|
17 | ** GNU General Public License Usage | |
18 | ** Alternatively, this file may be used under the terms of the GNU |
|
18 | ** Alternatively, this file may be used under the terms of the GNU | |
19 | ** General Public License version 3 or (at your option) any later version |
|
19 | ** General Public License version 3 or (at your option) any later version | |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
|
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by | |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
|
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 | |
22 | ** included in the packaging of this file. Please review the following |
|
22 | ** included in the packaging of this file. Please review the following | |
23 | ** information to ensure the GNU General Public License requirements will |
|
23 | ** information to ensure the GNU General Public License requirements will | |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
|
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. | |
25 | ** |
|
25 | ** | |
26 | ** $QT_END_LICENSE$ |
|
26 | ** $QT_END_LICENSE$ | |
27 | ** |
|
27 | ** | |
28 | ****************************************************************************/ |
|
28 | ****************************************************************************/ | |
29 |
|
29 | |||
30 | #ifndef QCHARTGLOBAL_H |
|
30 | #ifndef QCHARTGLOBAL_H | |
31 | #define QCHARTGLOBAL_H |
|
31 | #define QCHARTGLOBAL_H | |
32 |
|
32 | |||
33 | #include <QtCore/QtGlobal> |
|
33 | #include <QtCore/QtGlobal> | |
34 |
|
34 | |||
35 |
#define QT_CHARTS_VERSION_STR |
|
35 | #define QT_CHARTS_VERSION_STR QT_VERSION_STR | |
36 | /* |
|
36 | /* | |
37 | QT_CHARTS_VERSION is (major << 16) + (minor << 8) + patch. |
|
37 | QT_CHARTS_VERSION is (major << 16) + (minor << 8) + patch. | |
38 | */ |
|
38 | */ | |
39 |
#define QT_CHARTS_VERSION |
|
39 | #define QT_CHARTS_VERSION QT_VERSION | |
40 | /* |
|
40 | /* | |
41 | can be used like #if (QT_CHARTS_VERSION >= QT_CHARTS_VERSION_CHECK(1, 1, 0)) |
|
41 | can be used like #if (QT_CHARTS_VERSION >= QT_CHARTS_VERSION_CHECK(1, 1, 0)) | |
42 | */ |
|
42 | */ | |
43 | #define QT_CHARTS_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) |
|
43 | #define QT_CHARTS_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) | |
44 |
|
44 | |||
45 | #if defined(QT_CHARTS_LIBRARY) |
|
45 | #if defined(QT_CHARTS_LIBRARY) | |
46 | # define QT_CHARTS_EXPORT Q_DECL_EXPORT |
|
46 | # define QT_CHARTS_EXPORT Q_DECL_EXPORT | |
47 | #else |
|
47 | #else | |
48 | # define QT_CHARTS_EXPORT Q_DECL_IMPORT |
|
48 | # define QT_CHARTS_EXPORT Q_DECL_IMPORT | |
49 | #endif |
|
49 | #endif | |
50 |
|
50 | |||
51 | #ifdef QT_CHARTS_STATICLIB |
|
51 | #ifdef QT_CHARTS_STATICLIB | |
52 | # undef QT_CHARTS_EXPORT |
|
52 | # undef QT_CHARTS_EXPORT | |
53 | # undef Q_AUTOTEST_EXPORT |
|
53 | # undef Q_AUTOTEST_EXPORT | |
54 | # define QT_CHARTS_EXPORT |
|
54 | # define QT_CHARTS_EXPORT | |
55 | # define Q_AUTOTEST_EXPORT |
|
55 | # define Q_AUTOTEST_EXPORT | |
56 | #endif |
|
56 | #endif | |
57 |
|
57 | |||
58 | #define QT_CHARTS_NAMESPACE QtCharts |
|
58 | #define QT_CHARTS_NAMESPACE QtCharts | |
59 |
|
59 | |||
60 | #ifdef QT_CHARTS_NAMESPACE |
|
60 | #ifdef QT_CHARTS_NAMESPACE | |
61 | # define QT_CHARTS_BEGIN_NAMESPACE namespace QT_CHARTS_NAMESPACE { |
|
61 | # define QT_CHARTS_BEGIN_NAMESPACE namespace QT_CHARTS_NAMESPACE { | |
62 | # define QT_CHARTS_END_NAMESPACE } |
|
62 | # define QT_CHARTS_END_NAMESPACE } | |
63 | # define QT_CHARTS_USE_NAMESPACE using namespace QT_CHARTS_NAMESPACE; |
|
63 | # define QT_CHARTS_USE_NAMESPACE using namespace QT_CHARTS_NAMESPACE; | |
64 | #else |
|
64 | #else | |
65 | # define QT_CHARTS_BEGIN_NAMESPACE |
|
65 | # define QT_CHARTS_BEGIN_NAMESPACE | |
66 | # define QT_CHARTS_END_NAMESPACE |
|
66 | # define QT_CHARTS_END_NAMESPACE | |
67 | # define QT_CHARTS_USE_NAMESPACE |
|
67 | # define QT_CHARTS_USE_NAMESPACE | |
68 | #endif |
|
68 | #endif | |
69 |
|
69 | |||
70 | /* |
|
70 | /* | |
71 | On Windows min and max conflict with standard macros |
|
71 | On Windows min and max conflict with standard macros | |
72 | */ |
|
72 | */ | |
73 | #ifdef Q_OS_WIN |
|
73 | #ifdef Q_OS_WIN | |
74 | #ifndef NOMINMAX |
|
74 | #ifndef NOMINMAX | |
75 | #define NOMINMAX |
|
75 | #define NOMINMAX | |
76 | #endif |
|
76 | #endif | |
77 | #endif |
|
77 | #endif | |
78 |
|
78 | |||
79 | #endif // QCHARTGLOBAL_H |
|
79 | #endif // QCHARTGLOBAL_H |
General Comments 0
You need to be logged in to leave comments.
Login now