summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization
diff options
context:
space:
mode:
Diffstat (limited to 'examples/datavisualization')
-rw-r--r--examples/datavisualization/qmloscilloscope/datasource.cpp4
-rw-r--r--examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc8
2 files changed, 12 insertions, 0 deletions
diff --git a/examples/datavisualization/qmloscilloscope/datasource.cpp b/examples/datavisualization/qmloscilloscope/datasource.cpp
index c9993a6b..8b10bcc7 100644
--- a/examples/datavisualization/qmloscilloscope/datasource.cpp
+++ b/examples/datavisualization/qmloscilloscope/datasource.cpp
@@ -21,16 +21,20 @@
using namespace QtDataVisualization;
+//! [3]
Q_DECLARE_METATYPE(QSurface3DSeries *)
Q_DECLARE_METATYPE(QValue3DAxis *)
+//! [3]
DataSource::DataSource(QObject *parent) :
QObject(parent),
m_index(-1),
m_resetArray(0)
{
+ //! [4]
qRegisterMetaType<QSurface3DSeries *>();
qRegisterMetaType<QValue3DAxis *>();
+ //! [4]
}
DataSource::~DataSource()
diff --git a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
index 13e50709..e5a84b86 100644
--- a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
+++ b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
@@ -69,6 +69,14 @@
\snippet qmloscilloscope/main.cpp 0
+ To make it possible to use Qt Data Visualization class pointers as parameters on the
+ \c DataSource class methods on all environments and builds, we need to make sure the meta
+ types are registered:
+
+ \snippet qmloscilloscope/datasource.cpp 3
+ \dots 0
+ \snippet qmloscilloscope/datasource.cpp 4
+
\section1 QML
In the QML codes, we define a Surface3D graph normally and give it a Surface3DSeries: