diff options
-rw-r--r-- | examples/audiolevels/doc/src/audiolevels.qdoc | 2 | ||||
-rw-r--r-- | examples/bars/doc/src/bars.qdoc | 2 | ||||
-rw-r--r-- | examples/qmlbars/doc/src/qmlbars.qdoc | 2 | ||||
-rw-r--r-- | examples/qmlscatter/doc/src/qmlscatter.qdoc | 2 | ||||
-rw-r--r-- | examples/qmlsurface/doc/src/qmlsurface.qdoc | 2 | ||||
-rw-r--r-- | examples/rainfall/doc/src/rainfall.qdoc | 2 | ||||
-rw-r--r-- | examples/scatter/doc/src/scatter.qdoc | 2 | ||||
-rw-r--r-- | examples/surface/doc/src/surface.qdoc | 31 | ||||
-rw-r--r-- | examples/surface/surface.pro | 3 | ||||
-rw-r--r-- | examples/widget/doc/src/widget.qdoc | 2 | ||||
-rw-r--r-- | src/datavisualization/doc/snippets/doc_src_q3dbars_construction.cpp | 4 | ||||
-rw-r--r-- | src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp | 23 | ||||
-rw-r--r-- | src/datavisualization/doc/src/qtdatavisualization-index.qdoc | 14 | ||||
-rw-r--r-- | src/datavisualization/doc/src/qtdatavisualization.qdoc | 48 | ||||
-rw-r--r-- | src/datavisualization/engine/q3dbars.cpp | 6 |
15 files changed, 129 insertions, 16 deletions
diff --git a/examples/audiolevels/doc/src/audiolevels.qdoc b/examples/audiolevels/doc/src/audiolevels.qdoc index 0ac9de78..0d8144a6 100644 --- a/examples/audiolevels/doc/src/audiolevels.qdoc +++ b/examples/audiolevels/doc/src/audiolevels.qdoc @@ -19,6 +19,8 @@ /*! \example audiolevels \title Audiolevels Example + \ingroup qtdatavisualization_examples + \brief Simple application showing real time audio data. The audiolevels example shows how feed dynamic data to a graph using Q3DBars. diff --git a/examples/bars/doc/src/bars.qdoc b/examples/bars/doc/src/bars.qdoc index 8a9a4458..1db72e47 100644 --- a/examples/bars/doc/src/bars.qdoc +++ b/examples/bars/doc/src/bars.qdoc @@ -19,6 +19,8 @@ /*! \example bars \title Bars Example + \ingroup qtdatavisualization_examples + \brief Using an item model as data source for Q3DBars. The bars example shows how to make a simple 3D bar graph using Q3DBars. diff --git a/examples/qmlbars/doc/src/qmlbars.qdoc b/examples/qmlbars/doc/src/qmlbars.qdoc index e382bb6b..c9fb564a 100644 --- a/examples/qmlbars/doc/src/qmlbars.qdoc +++ b/examples/qmlbars/doc/src/qmlbars.qdoc @@ -19,6 +19,8 @@ /*! \example qmlbars \title Qt Quick 2 Bars Example + \ingroup qtdatavisualization_examples + \brief Using Bars3D in a QML application. The Qt Quick 2 bars example shows how to make a simple 3D bar graph using Q3DBars and Qt Quick 2. diff --git a/examples/qmlscatter/doc/src/qmlscatter.qdoc b/examples/qmlscatter/doc/src/qmlscatter.qdoc index 590b9a30..e5bb10ad 100644 --- a/examples/qmlscatter/doc/src/qmlscatter.qdoc +++ b/examples/qmlscatter/doc/src/qmlscatter.qdoc @@ -19,6 +19,8 @@ /*! \example qmlscatter \title Qt Quick 2 Scatter Example + \ingroup qtdatavisualization_examples + \brief Using Scatter3D in a QML application. The Qt Quick 2 scatter example shows how to make a simple scatter graph visualization using Q3DScatter and Qt Quick 2. diff --git a/examples/qmlsurface/doc/src/qmlsurface.qdoc b/examples/qmlsurface/doc/src/qmlsurface.qdoc index c589d55a..dba40327 100644 --- a/examples/qmlsurface/doc/src/qmlsurface.qdoc +++ b/examples/qmlsurface/doc/src/qmlsurface.qdoc @@ -19,6 +19,8 @@ /*! \example qmlsurface \title Qt Quick 2 Surface Example + \ingroup qtdatavisualization_examples + \brief Using Surface3D in a QML application. The Qt Quick 2 surface example shows how to make a simple 3D surface plot using Q3DSurface with Qt Quick 2. diff --git a/examples/rainfall/doc/src/rainfall.qdoc b/examples/rainfall/doc/src/rainfall.qdoc index c28029a4..aef14576 100644 --- a/examples/rainfall/doc/src/rainfall.qdoc +++ b/examples/rainfall/doc/src/rainfall.qdoc @@ -19,6 +19,8 @@ /*! \example rainfall \title Rainfall Example + \ingroup qtdatavisualization_examples + \brief Using Q3DBars in an application. The bars example shows how to make a simple 3D bar graph using Q3DBars. diff --git a/examples/scatter/doc/src/scatter.qdoc b/examples/scatter/doc/src/scatter.qdoc index 7f4bda38..5053d77a 100644 --- a/examples/scatter/doc/src/scatter.qdoc +++ b/examples/scatter/doc/src/scatter.qdoc @@ -19,6 +19,8 @@ /*! \example scatter \title Scatter Example + \ingroup qtdatavisualization_examples + \brief Using Q3DScatter in a widget application. The scatter example shows how to make a simple 3D scatter graph using Q3DScatter and combining the use of widgets for adjusting several adjustable qualities. diff --git a/examples/surface/doc/src/surface.qdoc b/examples/surface/doc/src/surface.qdoc new file mode 100644 index 00000000..7810c543 --- /dev/null +++ b/examples/surface/doc/src/surface.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +/*! + \example surface + \title Surface Example + \ingroup qtdatavisualization_examples + \brief Using Q3DSurface in a widget application. + + The surface example shows how to make a simple 3D surface graph using Q3DSurface and + combining the use of widgets for adjusting several adjustable qualities. + + \image surface-example.png + + TODO +*/ diff --git a/examples/surface/surface.pro b/examples/surface/surface.pro index 54302d6b..20c8a1a8 100644 --- a/examples/surface/surface.pro +++ b/examples/surface/surface.pro @@ -12,3 +12,6 @@ QT += widgets INSTALLS += target RESOURCES += surface.qrc + +OTHER_FILES += doc/src/* \ + doc/images/* diff --git a/examples/widget/doc/src/widget.qdoc b/examples/widget/doc/src/widget.qdoc index e0c0f14b..12d621fa 100644 --- a/examples/widget/doc/src/widget.qdoc +++ b/examples/widget/doc/src/widget.qdoc @@ -19,6 +19,8 @@ /*! \example widget \title Widget Example + \ingroup qtdatavisualization_examples + \brief Using Q3DBars in a widget application. The widget example shows how to make a 3D bar graph using Q3DBars and combining the use of widgets for adjusting several adjustable qualities. diff --git a/src/datavisualization/doc/snippets/doc_src_q3dbars_construction.cpp b/src/datavisualization/doc/snippets/doc_src_q3dbars_construction.cpp index 17abfd46..a5615601 100644 --- a/src/datavisualization/doc/snippets/doc_src_q3dbars_construction.cpp +++ b/src/datavisualization/doc/snippets/doc_src_q3dbars_construction.cpp @@ -25,8 +25,10 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); - //! [0] + //! [4] Q3DBars *bars = new Q3DBars(); + //! [4] + //! [0] bars->rowAxis()->setRange(0, 4); bars->columnAxis()->setRange(0, 4); //! [0] diff --git a/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp b/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp index 54f64ef0..b64755e1 100644 --- a/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp +++ b/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp @@ -18,6 +18,8 @@ //! [0] #include <QtDataVisualization> + +using namespace QtDataVisualization; //! [0] //! [1] @@ -76,3 +78,24 @@ QItemModelSurfaceDataMapping *mapping = new QItemModelSurfaceDataMapping(QString QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(customModel, mapping); //! [5] + +//! [6] +qmake +make +//! [6] + +//! [7] +qmake CONFIG+=static +make +//! [7] + +//! [8] +qmake +make +./qmlsurface +//! [8] + +//! [9] +Q3DBars *graph = new Q3DBars(); +QWidget *container = QWidget::createWindowContainer(graph); +//! [9] diff --git a/src/datavisualization/doc/src/qtdatavisualization-index.qdoc b/src/datavisualization/doc/src/qtdatavisualization-index.qdoc index 7ec90eaa..f2245c12 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-index.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-index.qdoc @@ -46,7 +46,7 @@ \snippet doc_src_qmldatavisualization.cpp 0 If you intend to use Qt Data Visualization C++ classes in your application, use the - following directive: + following include and using directives: \snippet doc_src_qtdatavisualization.cpp 0 @@ -74,15 +74,5 @@ Qt Data Visualization comes with the following examples: - \list - \li \l{Bars Example} - \li \l{Qt Quick 2 Bars Example} - \li \l{Qt Quick 2 Scatter Example} - \li \l{Qt Quick 2 Surface Example} - \li \l{Rainfall Example} - \li \l{Scatter Example} - \li \l{Surface Example} - \li \l{Audiolevels Example} - \li \l{Widget Example} - \endlist + \annotatedlist qtdatavisualization_examples */ diff --git a/src/datavisualization/doc/src/qtdatavisualization.qdoc b/src/datavisualization/doc/src/qtdatavisualization.qdoc index c0e317d0..ba158d27 100644 --- a/src/datavisualization/doc/src/qtdatavisualization.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization.qdoc @@ -41,11 +41,55 @@ \section1 Building Qt Data Visualization - TODO + To build Qt Data Visualization module, set up a command prompt with an environment for + building Qt applications, navigate to the directory containing \c qtdatavisualization.pro, + and give the following commands: + + \snippet doc_src_qtdatavisualization.cpp 6 + + \note The \c make tool name may vary depending on your target platform. + E.g. make/nmake/mingw32-make/... + + To build a statically linked version of the Qt Data Visualization module, give the following + commands: + + \snippet doc_src_qtdatavisualization.cpp 7 + + \section1 Running examples + + Qt Data Visualization examples are found under \c examples subdirectory. To build and run a + single example, e.g. the qmlsurface example, navigate to the example directory and give the + following commands: + + \snippet doc_src_qtdatavisualization.cpp 8 + + \note On some platforms, such as Windows, the executable can be generated under debug or + release folders, depending on your build. \section1 Creating a simple application - TODO + To create a simple application, start by creating a new Qt Gui Application project in Qt + Creator and add this line to the \c .pro file of the project: + + \snippet doc_src_qtdatavisualization.pro 0 + + In the \c main.cpp file, include the module headers and declare namespace usage: + + \snippet doc_src_qtdatavisualization.cpp 0 + + Then, add the sample code found in one of the following pages, depending on what kind of + visualization you are interested in: \l{How to construct a minimal Q3DBars graph}, + \l{How to construct a minimal Q3DScatter graph}, or + \l{How to construct a minimal Q3DSurface graph}. + + To use Qt Data Visualization graphs in widget based applications, you can use + QWidget::createWindowContainer() function to wrap the graph into a widget: + + \snippet doc_src_qtdatavisualization.cpp 9 + + For further code examples, see one of the Qt Data Visualization examples: + + \annotatedlist qtdatavisualization_examples */ /*! diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp index 660b046b..ef0eb88b 100644 --- a/src/datavisualization/engine/q3dbars.cpp +++ b/src/datavisualization/engine/q3dbars.cpp @@ -54,6 +54,10 @@ QT_DATAVISUALIZATION_BEGIN_NAMESPACE * * \section1 How to construct a minimal Q3DBars graph * + * First, construct an instance of Q3DBars: + * + * \snippet doc_src_q3dbars_construction.cpp 4 + * * After constructing Q3DBars, you can set the data window by changing the range on the row and * column axes. It is not mandatory, as data window will default to showing all of the data in * the data proxy. If the amount of data is large, it is usually preferable to show just a @@ -66,7 +70,7 @@ QT_DATAVISUALIZATION_BEGIN_NAMESPACE * * \snippet doc_src_q3dbars_construction.cpp 1 * - * \note We set the sample space to 5 x 5, but we are inserting only one row of data. This is ok, + * \note We set the data window to 5 x 5, but we are inserting only one row of data. This is ok, * the rest of the rows will just be blank. * * Finally you will need to set it visible: |