diff options
author | Titta Heikkala <titta.heikkala@digia.com> | 2014-07-01 07:10:00 +0300 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2014-10-14 13:04:52 +0300 |
commit | c544258484ff4fd5d2b88402fbaa5d154b89a3a2 (patch) | |
tree | 7659625abb566dec55d3783ed820b928542d9b2b /doc/src/examples-modeldata.qdoc | |
parent | 76339f714f088645e911cee65bdb66055fe029aa (diff) |
Qt Charts project file structure change
Charts repository structure is changed to follow the structure of a
Qt Add-On module. The task includes following changes:
- All macros and definitions named 'commercial' have been renamed.
- Compile errors related to QString and qSort usage have been fixed.
- Old demos are moved under examples. The QML examples now support only
Qt Quick 2.0, the support for Qt Quick 1 is removed.
- The QML examples with multiple views are updated so that they are
usable also with touch devices.
- Unnecessary version checks are removed from examples.
- The build stamp has been removed as it was only meant for Charts
development purposes and it's no longer needed. Also development
build related debug prints are removed as __DATE__ can't be used
for all OS thus it doesn't make much sense.
- Documentation structure has been updated based on the new module
structure. The raw HTML files have been removed. Demos are
combined to examples.
- Unnecessary .qdocinc files are no longer needed. The content is
moved to the corresponding .cpp files.
- The Charts widget designer plugin is updated according to the module
change.
- The test cases updated according to the project structure change.
Tests are added also for version 2.0.
- cmake modules generation is not needed with Qt 5.4 and Qt Charts
so it's disabled.
- The new module name and version are updated to the plugin.qmltypes
file.
Task-number: QTRD-2844, QTRD-3217, QTRD-3218, QTRD-3277, QTRD-3228,
QTRD-2526, QTRD-3233, QTRD-3222
Change-Id: Ib7fb26057cde710ffaf6bc780c8bf52a16f45160
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'doc/src/examples-modeldata.qdoc')
-rw-r--r-- | doc/src/examples-modeldata.qdoc | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/doc/src/examples-modeldata.qdoc b/doc/src/examples-modeldata.qdoc deleted file mode 100644 index e8f66558..00000000 --- a/doc/src/examples-modeldata.qdoc +++ /dev/null @@ -1,58 +0,0 @@ -/*! - \example examples/modeldata - \title Model Data Example - \subtitle - - This example shows how to use the QAbstractItemModel derived model as the data for the series. - - \image examples_modeldata.png - - Let's start by creating an instance of the CustomTableModel class. - The CustomTableModel class is derived from QAbstractTableModel and it was created for the purpose of this example. - The constructor of this class populates the internal data store of the model with the data that is suitable for our chart example. - - \snippet ../examples/modeldata/tablewidget.cpp 1 - - We now have a model with data that we would like to display both on the chart and in a QTableView. - First, we create QTableView and tell it to use the model as a data source. To make the data cells fill the table view we also change headers resize mode. - - \snippet ../examples/modeldata/tablewidget.cpp 2 - - Now we need the QChart instance to display the same data on the chart. - We also enable animations. It makes it easier to see how modifying the model's data affect the chart. - - \snippet ../examples/modeldata/tablewidget.cpp 3 - - The code below creates new line series and gives it a name. The following line creates an instance of QVXYModelMapper class. - The next two lines specify that X-coordinates are taken from the model's column(Qt::Vertical) with index 0. The Y-coordinates are taken from the model's column with index 1. - To create a connection between the series and the model we set both of those objects to QVXYModelMapper. - - Finally, the series is added to the chart. - - \snippet ../examples/modeldata/tablewidget.cpp 4 - - To show in QTableView which data corresponds with which series this example uses table coloring. - When a series is added to the chart it is assigned a color based on the currently selected theme. - The code below extracts that color from the series and uses it to create a colored QTableView. - The coloring of the view is not a part of the QChart functionality. - - \snippet ../examples/modeldata/tablewidget.cpp 5 - - The same operations are done with a second series. Notice that for this series different columns of the same model are mapped. - - \snippet ../examples/modeldata/tablewidget.cpp 6 - - \snippet ../examples/modeldata/tablewidget.cpp 7 - - To avoid setting up the QGraphicsScene we use the QChartView class that does it for us. - QChart object pointer is used as a parameter of the QChartView constructor. - To make the chart look nicer, Antialiasing is turned on and the minimum size of the chartView widget is set. - - \snippet ../examples/modeldata/tablewidget.cpp 8 - - Finally we place both widgets in a layout and use the layout as the application layout. - - \snippet ../examples/modeldata/tablewidget.cpp 9 - - The application is ready. Try modifying the data in the table view and see how it affects the chart. -*/ |