From e2904862ff62240345adaac4cef5ffd55e208a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 27 Feb 2014 08:43:13 +0200 Subject: Q3DCamera doc and API update Change-Id: Id33645c7f921ad7289c2e368a656ee1c7b2d69ea Reviewed-by: Miikka Heikkinen --- .../datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml | 6 +++--- src/datavisualization/engine/q3dcamera.cpp | 10 +++++----- src/datavisualization/engine/q3dcamera.h | 10 +++++----- src/datavisualization/engine/q3dcamera_p.h | 2 +- tests/kinectsurface/surfacedata.cpp | 6 +++--- tests/multigraphs/data.cpp | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml b/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml index 46ff2067..9f0227ae 100644 --- a/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml +++ b/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml @@ -190,9 +190,9 @@ Rectangle { surfaceGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh scatterGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh barGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh - surfaceGraph.scene.activeCamera.zoomLevel = 100 - scatterGraph.scene.activeCamera.zoomLevel = 100 - barGraph.scene.activeCamera.zoomLevel = 100 + surfaceGraph.scene.activeCamera.zoomLevel = 100.0 + scatterGraph.scene.activeCamera.zoomLevel = 100.0 + barGraph.scene.activeCamera.zoomLevel = 100.0 } function toggleMeshStyle() { diff --git a/src/datavisualization/engine/q3dcamera.cpp b/src/datavisualization/engine/q3dcamera.cpp index c7342aa9..50f2e319 100644 --- a/src/datavisualization/engine/q3dcamera.cpp +++ b/src/datavisualization/engine/q3dcamera.cpp @@ -403,12 +403,12 @@ void Q3DCamera::setCameraPreset(CameraPreset preset) * This property contains the the camera zoom level in percentage. \c 100.0f means there is no zoom * in or out set in the camera. */ -int Q3DCamera::zoomLevel() const +float Q3DCamera::zoomLevel() const { return d_ptr->m_zoomLevel; } -void Q3DCamera::setZoomLevel(int zoomLevel) +void Q3DCamera::setZoomLevel(float zoomLevel) { if (d_ptr->m_zoomLevel != zoomLevel) { d_ptr->m_zoomLevel = zoomLevel; @@ -479,9 +479,9 @@ Q3DCameraPrivate::Q3DCameraPrivate(Q3DCamera *q) : m_minYRotation(0.0f), m_maxXRotation(180.0f), m_maxYRotation(90.0f), + m_zoomLevel(100.0f), m_wrapXRotation(true), m_wrapYRotation(false), - m_zoomLevel(100), m_activePreset(Q3DCamera::CameraPresetNone) { } @@ -642,7 +642,7 @@ void Q3DCameraPrivate::updateViewMatrix(float zoomAdjustment) if (!m_isViewMatrixUpdateActive) return; - int zoom = m_zoomLevel * zoomAdjustment; + GLfloat zoom = m_zoomLevel * zoomAdjustment; QMatrix4x4 viewMatrix; // Apply to view matrix @@ -656,7 +656,7 @@ void Q3DCameraPrivate::updateViewMatrix(float zoomAdjustment) // y rotation is always "clean" viewMatrix.rotate(m_yRotation, 1.0f, 0.0f, 0.0f); // handle zoom by scaling - viewMatrix.scale((GLfloat)zoom / 100.0f); + viewMatrix.scale(zoom / 100.0f); // Compensate for translation (if d_ptr->m_target is off origin) viewMatrix.translate(-m_target.x(), -m_target.y(), -m_target.z()); diff --git a/src/datavisualization/engine/q3dcamera.h b/src/datavisualization/engine/q3dcamera.h index 87602e5c..277035f4 100644 --- a/src/datavisualization/engine/q3dcamera.h +++ b/src/datavisualization/engine/q3dcamera.h @@ -31,7 +31,7 @@ class QT_DATAVISUALIZATION_EXPORT Q3DCamera : public Q3DObject Q_ENUMS(CameraPreset) Q_PROPERTY(float xRotation READ xRotation WRITE setXRotation NOTIFY xRotationChanged) Q_PROPERTY(float yRotation READ yRotation WRITE setYRotation NOTIFY yRotationChanged) - Q_PROPERTY(int zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged) + Q_PROPERTY(float zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged) Q_PROPERTY(CameraPreset cameraPreset READ cameraPreset WRITE setCameraPreset NOTIFY cameraPresetChanged) Q_PROPERTY(bool wrapXRotation READ wrapXRotation WRITE setWrapXRotation NOTIFY wrapXRotationChanged) Q_PROPERTY(bool wrapYRotation READ wrapYRotation WRITE setWrapYRotation NOTIFY wrapYRotationChanged) @@ -84,15 +84,15 @@ public: CameraPreset cameraPreset() const; void setCameraPreset(CameraPreset preset); - int zoomLevel() const; - void setZoomLevel(int zoomLevel); + float zoomLevel() const; + void setZoomLevel(float zoomLevel); - void setCameraPosition(float horizontal, float vertical, float distance = 100.0f); + void setCameraPosition(float horizontal, float vertical, float zoom = 100.0f); signals: void xRotationChanged(float rotation); void yRotationChanged(float rotation); - void zoomLevelChanged(int zoomLevel); + void zoomLevelChanged(float zoomLevel); void cameraPresetChanged(CameraPreset preset); void wrapXRotationChanged(bool isEnabled); void wrapYRotationChanged(bool isEnabled); diff --git a/src/datavisualization/engine/q3dcamera_p.h b/src/datavisualization/engine/q3dcamera_p.h index 884229e3..01e7a508 100644 --- a/src/datavisualization/engine/q3dcamera_p.h +++ b/src/datavisualization/engine/q3dcamera_p.h @@ -96,9 +96,9 @@ public: GLfloat m_minYRotation; GLfloat m_maxXRotation; GLfloat m_maxYRotation; + GLfloat m_zoomLevel; bool m_wrapXRotation; bool m_wrapYRotation; - int m_zoomLevel; Q3DCamera::CameraPreset m_activePreset; friend class Bars3DRenderer; diff --git a/tests/kinectsurface/surfacedata.cpp b/tests/kinectsurface/surfacedata.cpp index 14f37288..b1c173cd 100644 --- a/tests/kinectsurface/surfacedata.cpp +++ b/tests/kinectsurface/surfacedata.cpp @@ -90,7 +90,7 @@ SurfaceData::SurfaceData(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars gradient.setColorAt(1.0, Qt::yellow); m_surface->setSelectionMode(QAbstract3DGraph::SelectionNone); m_surface->setShadowQuality(QAbstract3DGraph::ShadowQualityNone); - m_surface->scene()->activeCamera()->setCameraPosition(0.0, 90.0, 150); + m_surface->scene()->activeCamera()->setCameraPosition(0.0, 90.0, 150.0); m_surface->axisY()->setMax(255); QSurface3DSeries *series1 = new QSurface3DSeries(new QHeightMapSurfaceDataProxy()); series1->setFlatShadingEnabled(true); @@ -102,7 +102,7 @@ SurfaceData::SurfaceData(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars m_scatter->setSelectionMode(QAbstract3DGraph::SelectionNone); m_scatter->activeTheme()->setGridEnabled(false); m_scatter->setShadowQuality(QAbstract3DGraph::ShadowQualityLow); - m_scatter->scene()->activeCamera()->setCameraPosition(0.0, 60.0, 150); + m_scatter->scene()->activeCamera()->setCameraPosition(0.0, 60.0, 150.0); QScatter3DSeries *series2 = new QScatter3DSeries; #ifdef LOW_END_DEVICE series2->setMesh(QAbstract3DSeries::MeshPoint); @@ -138,7 +138,7 @@ SurfaceData::SurfaceData(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars m_bars->setShadowQuality(QAbstract3DGraph::ShadowQualityLow); #endif m_bars->setBarSpacing(QSizeF(0.0, 0.0)); - m_bars->scene()->activeCamera()->setCameraPosition(0.0, 65.0, 130); + m_bars->scene()->activeCamera()->setCameraPosition(0.0, 65.0, 130.0); QBar3DSeries *series3 = new QBar3DSeries; series3->setMesh(QAbstract3DSeries::MeshBar); m_bars->addSeries(series3); diff --git a/tests/multigraphs/data.cpp b/tests/multigraphs/data.cpp index 9fd27b96..dc736d46 100644 --- a/tests/multigraphs/data.cpp +++ b/tests/multigraphs/data.cpp @@ -56,7 +56,7 @@ Data::Data(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars, m_surface->setSelectionMode(QAbstract3DGraph::SelectionNone); m_surface->activeTheme()->setGridEnabled(false); m_surface->activeTheme()->setBackgroundEnabled(false); - m_surface->scene()->activeCamera()->setCameraPosition(0.0, 90.0, 150); + m_surface->scene()->activeCamera()->setCameraPosition(0.0, 90.0, 150.0); QSurface3DSeries *series1 = new QSurface3DSeries(new QHeightMapSurfaceDataProxy()); series1->setFlatShadingEnabled(true); series1->setDrawMode(QSurface3DSeries::DrawSurface); @@ -69,7 +69,7 @@ Data::Data(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars, m_scatter->setSelectionMode(QAbstract3DGraph::SelectionNone); m_scatter->activeTheme()->setGridEnabled(false); m_scatter->setShadowQuality(QAbstract3DGraph::ShadowQualitySoftLow); - m_scatter->scene()->activeCamera()->setCameraPosition(0.0, 85.0, 150); + m_scatter->scene()->activeCamera()->setCameraPosition(0.0, 85.0, 150.0); QScatter3DSeries *series2 = new QScatter3DSeries; series2->setMesh(QAbstract3DSeries::MeshPoint); m_scatter->addSeries(series2); @@ -80,7 +80,7 @@ Data::Data(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars, m_bars->activeTheme()->setGridEnabled(false); m_bars->setShadowQuality(QAbstract3DGraph::ShadowQualityLow); m_bars->setBarSpacing(QSizeF(0.0, 0.0)); - m_bars->scene()->activeCamera()->setCameraPosition(0.0, 75.0, 150); + m_bars->scene()->activeCamera()->setCameraPosition(0.0, 75.0, 150.0); QBar3DSeries *series3 = new QBar3DSeries; series3->setMesh(QAbstract3DSeries::MeshBar); m_bars->addSeries(series3); -- cgit v1.2.3 From 297d23b2f73939953108c504c0264179cd2136af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 27 Feb 2014 09:04:44 +0200 Subject: Doc fixes - Q3DObject - Q3DTheme Change-Id: I9d5717beece4426b9611b6b81a4dcf388373de2b Change-Id: I9d5717beece4426b9611b6b81a4dcf388373de2b Reviewed-by: Miikka Heikkinen --- .../datavisualization/rotations/scatterdatamodifier.cpp | 4 ++-- src/datavisualization/engine/q3dobject.cpp | 2 +- src/datavisualization/theme/q3dtheme.cpp | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/datavisualization/rotations/scatterdatamodifier.cpp b/examples/datavisualization/rotations/scatterdatamodifier.cpp index 90af63ab..c4b439b1 100644 --- a/examples/datavisualization/rotations/scatterdatamodifier.cpp +++ b/examples/datavisualization/rotations/scatterdatamodifier.cpp @@ -111,13 +111,13 @@ void ScatterDataModifier::generateData() float xCenter = ellipse_a * qCos(horizontalAngle); float zCenter = ellipse_a * qSin(horizontalAngle); - // Rotate - arrow always tangential to origo + // Rotate - arrow always tangential to origin //! [0] QQuaternion yRotation = QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, horizontalAngle * radiansToDegrees); //! [0] for (float j = 0; j < m_arrowsPerLine; j++) { - // Calculate point on ellipse centered on origo and parallel to x-axis + // Calculate point on ellipse centered on origin and parallel to x-axis float verticalAngle = ((doublePi * j) / m_arrowsPerLine) + m_angleOffset; float xUnrotated = ellipse_a * qCos(verticalAngle); float y = ellipse_b * qSin(verticalAngle); diff --git a/src/datavisualization/engine/q3dobject.cpp b/src/datavisualization/engine/q3dobject.cpp index cda4a370..05edf287 100644 --- a/src/datavisualization/engine/q3dobject.cpp +++ b/src/datavisualization/engine/q3dobject.cpp @@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * Constructs a new 3D object with position set to origo by default. An + * Constructs a new 3D object with position set to origin by default. An * optional \a parent parameter can be given and is then passed to QObject constructor. */ Q3DObject::Q3DObject(QObject *parent) : diff --git a/src/datavisualization/theme/q3dtheme.cpp b/src/datavisualization/theme/q3dtheme.cpp index a3703779..83da96f8 100644 --- a/src/datavisualization/theme/q3dtheme.cpp +++ b/src/datavisualization/theme/q3dtheme.cpp @@ -56,20 +56,21 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \li List of colors for the objects in the graph. Colors are applied to series one by one. * If there are more series than colors, the color list is reused from the start. * The colors in this property are used if colorStyle is ColorStyleUniform. This can be - * overridden by setting the baseColor explicitly in series. + * overridden by setting the \l{QAbstract3DSeries::baseColor}{baseColor} explicitly in series. * \li Qt::black * \row * \li baseGradients * \li List of gradients for the objects in the graph. Gradients are applied to series one by * one. If there are more series than gradients, the gradient list is reused from the start. * The gradients in this property are used if colorStyle is ColorStyleObjectGradient or - * ColorStyleRangeGradient. This can be overridden by setting the baseGradient explicitly - * in series. + * ColorStyleRangeGradient. This can be overridden by setting the + * \l{QAbstract3DSeries::baseGradient}{baseGradient} explicitly in series. * \li QLinearGradient(). Essentially fully black. * \row * \li colorStyle * \li The color style of the objects in the graph. See ColorStyle for detailed description of - * the styles. This can be overridden by setting the colorStyle explicitly in series. + * the styles. This can be overridden by setting the + * \l{QAbstract3DSeries::colorStyle}{colorStyle} explicitly in series. * \li ColorStyleUniform * \row * \li \l font @@ -170,15 +171,15 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * Color styles. * * \value ColorStyleUniform - * Objects are rendered in a single color. The color used is specified in baseColor, + * Objects are rendered in a single color. The color used is specified in baseColors, * singleHighlightColor and multiHighlightColor properties. * \value ColorStyleObjectGradient * Objects are colored using a full gradient for each object regardless of object height. The - * gradient used is specified in baseGradient, singleHighlightGradient and + * gradient used is specified in baseGradients, singleHighlightGradient and * multiHighlightGradient properties. * \value ColorStyleRangeGradient * Objects are colored using a portion of the full gradient determined by the object's - * height and its position on the Y-axis. The gradient used is specified in baseGradient, + * height and its position on the Y-axis. The gradient used is specified in baseGradients, * singleHighlightGradient and multiHighlightGradient properties. */ -- cgit v1.2.3 From 5bcdebd086c3d5ea9d6c1874985f7df0eacb4489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 27 Feb 2014 09:37:55 +0200 Subject: Doc fixes - QAbstract3DAxis - QAbstract3dSeries - QAbstract3DGraph - QAbstract3DInputHandler Change-Id: Ida248755523fb3de7d2f9dfda274429200525737 Change-Id: Ida248755523fb3de7d2f9dfda274429200525737 Reviewed-by: Miikka Heikkinen --- src/datavisualization/axis/qabstract3daxis.cpp | 4 +-- src/datavisualization/data/qabstract3dseries.cpp | 42 +++++++++++----------- src/datavisualization/engine/qabstract3dgraph.cpp | 4 +-- .../input/qabstract3dinputhandler.cpp | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/datavisualization/axis/qabstract3daxis.cpp b/src/datavisualization/axis/qabstract3daxis.cpp index 39b1230e..3a327caa 100644 --- a/src/datavisualization/axis/qabstract3daxis.cpp +++ b/src/datavisualization/axis/qabstract3daxis.cpp @@ -129,7 +129,7 @@ QAbstract3DAxis::~QAbstract3DAxis() /*! * \property QAbstract3DAxis::orientation * - * Defines the orientation of the axis, one of \c QAbstract3DAxis::AxisOrientation. + * Defines the orientation of the axis, one of AxisOrientation. */ QAbstract3DAxis::AxisOrientation QAbstract3DAxis::orientation() const { @@ -139,7 +139,7 @@ QAbstract3DAxis::AxisOrientation QAbstract3DAxis::orientation() const /*! * \property QAbstract3DAxis::type * - * Defines the type of the axis, one of \c QAbstract3DAxis::AxisType. + * Defines the type of the axis, one of AxisType. */ QAbstract3DAxis::AxisType QAbstract3DAxis::type() const { diff --git a/src/datavisualization/data/qabstract3dseries.cpp b/src/datavisualization/data/qabstract3dseries.cpp index 4d201c45..e593a1d9 100644 --- a/src/datavisualization/data/qabstract3dseries.cpp +++ b/src/datavisualization/data/qabstract3dseries.cpp @@ -126,7 +126,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty Abstract3DSeries.Mesh Abstract3DSeries::mesh * - * Sets the mesh of the items in the series, or the selection pointer in case of + * Sets the \a mesh of the items in the series, or the selection pointer in case of * Surface3DSeries. If the \a mesh is \l{QAbstract3DSeries::MeshUserDefined}{Abstract3DSeries.MeshUserDefined}, * then the userDefinedMesh property must also be set for items to render properly. * The default value depends on the graph type. @@ -138,7 +138,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * If \a enable is \c true, smooth versions of predefined meshes set via mesh property are used. * This property doesn't affect custom meshes used when mesh is * \l{QAbstract3DSeries::MeshUserDefined}{Abstract3DSeries.MeshUserDefined}. - * Defaults to \c false. + * Defaults to \c{false}. */ /*! @@ -173,7 +173,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty Color Abstract3DSeries::baseColor * - * Sets the base \c color of the series. + * Sets the base \a color of the series. * See \l{Theme3D::baseColors}{Theme3D.baseColors} * documentation for more information. * @@ -183,7 +183,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty ColorGradient Abstract3DSeries::baseGradient * - * Sets the base \c gradient of the series. + * Sets the base \a gradient of the series. * See \l{Theme3D::baseGradients}{Theme3D.baseGradients} * documentation for more information. * @@ -193,7 +193,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty Color Abstract3DSeries::singleHighlightColor * - * Sets the single item highlight \c color of the series. + * Sets the single item highlight \a color of the series. * See \l{Theme3D::singleHighlightColor}{Theme3D.singleHighlightColor} * documentation for more information. * @@ -203,7 +203,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty ColorGradient Abstract3DSeries::singleHighlightGradient * - * Sets the single item highlight \c gradient of the series. + * Sets the single item highlight \a gradient of the series. * See \l{Theme3D::singleHighlightGradient}{Theme3D.singleHighlightGradient} * documentation for more information. * @@ -213,7 +213,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty Color Abstract3DSeries::multiHighlightColor * - * Sets the multiple item highlight \c color of the series. + * Sets the multiple item highlight \a color of the series. * See \l{Theme3D::multiHighlightColor}{Theme3D.multiHighlightColor} * documentation for more information. * @@ -223,7 +223,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty ColorGradient Abstract3DSeries::multiHighlightGradient * - * Sets the multiple item highlight \c gradient of the series. + * Sets the multiple item highlight \a gradient of the series. * See \l{Theme3D::multiHighlightGradient}{Theme3D.multiHighlightGradient} * documentation for more information. * @@ -299,7 +299,7 @@ QString QAbstract3DSeries::itemLabelFormat() const * \property QAbstract3DSeries::visible * * Sets the visibility of the series. If \a visible is false, the series is not rendered. - * Defaults to true. + * Defaults to \c{true}. */ void QAbstract3DSeries::setVisible(bool visible) { @@ -317,7 +317,7 @@ bool QAbstract3DSeries::isVisible() const /*! * \property QAbstract3DSeries::mesh * - * Sets the mesh of the items in the series, or the selection pointer in case of + * Sets the \a mesh of the items in the series, or the selection pointer in case of * QSurface3DSeries. If the \a mesh is MeshUserDefined, then the userDefinedMesh property * must also be set for items to render properly. The default value depends on the graph type. */ @@ -343,7 +343,7 @@ QAbstract3DSeries::Mesh QAbstract3DSeries::mesh() const * * If \a enable is \c true, smooth versions of predefined meshes set via mesh property are used. * This property doesn't affect custom meshes used when mesh is MeshUserDefined. - * Defaults to \c false. + * Defaults to \c{false}. */ void QAbstract3DSeries::setMeshSmooth(bool enable) { @@ -436,8 +436,8 @@ Q3DTheme::ColorStyle QAbstract3DSeries::colorStyle() const /*! * \property QAbstract3DSeries::baseColor * - * Sets the base \c color of the series. - * See Q3DTheme::baseColor documentation for more information. + * Sets the base \a color of the series. + * See Q3DTheme::baseColors documentation for more information. * * \sa colorStyle */ @@ -458,8 +458,8 @@ QColor QAbstract3DSeries::baseColor() const /*! * \property QAbstract3DSeries::baseGradient * - * Sets the base \c gradient of the series. - * See Q3DTheme::baseGradient documentation for more information. + * Sets the base \a gradient of the series. + * See Q3DTheme::baseGradients documentation for more information. * * \sa colorStyle */ @@ -480,7 +480,7 @@ QLinearGradient QAbstract3DSeries::baseGradient() const /*! * \property QAbstract3DSeries::singleHighlightColor * - * Sets the single item highlight \c color of the series. + * Sets the single item highlight \a color of the series. * See Q3DTheme::singleHighlightColor documentation for more information. * * \sa colorStyle @@ -502,7 +502,7 @@ QColor QAbstract3DSeries::singleHighlightColor() const /*! * \property QAbstract3DSeries::singleHighlightGradient * - * Sets the single item highlight \c gradient of the series. + * Sets the single item highlight \a gradient of the series. * See Q3DTheme::singleHighlightGradient documentation for more information. * * \sa colorStyle @@ -524,7 +524,7 @@ QLinearGradient QAbstract3DSeries::singleHighlightGradient() const /*! * \property QAbstract3DSeries::multiHighlightColor * - * Sets the multiple item highlight \c color of the series. + * Sets the multiple item highlight \a color of the series. * See Q3DTheme::multiHighlightColor documentation for more information. * * \sa colorStyle @@ -546,7 +546,7 @@ QColor QAbstract3DSeries::multiHighlightColor() const /*! * \property QAbstract3DSeries::multiHighlightGradient * - * Sets the multiple item highlight \c gradient of the series. + * Sets the multiple item highlight \a gradient of the series. * See Q3DTheme::multiHighlightGradient documentation for more information. * * \sa colorStyle @@ -568,8 +568,8 @@ QLinearGradient QAbstract3DSeries::multiHighlightGradient() const /*! * \property QAbstract3DSeries::name * - * Sets the series name. - * Series name can be used in item label format with tag \c{@seriesName}. + * Sets the series \a name. + * Series \a name can be used in item label format with tag \c{@seriesName}. * * \sa itemLabelFormat */ diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index f2102b29..1551c639 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -317,7 +317,7 @@ QAbstract3DGraph::SelectionFlags QAbstract3DGraph::selectionMode() const * \c ShadowQualityMedium by default. * * \note If setting ShadowQuality of a certain level fails, a level is lowered - * until it is successful and shadowQualityChanged signal is emitted for each time the change is + * until it is successful and \c shadowQualityChanged signal is emitted for each time the change is * done. */ void QAbstract3DGraph::setShadowQuality(ShadowQuality quality) @@ -333,7 +333,7 @@ QAbstract3DGraph::ShadowQuality QAbstract3DGraph::shadowQuality() const /*! * \property QAbstract3DGraph::scene * - * This property contains the read only Q3DScene that can be used to access for example a camera object. + * This property contains the read only Q3DScene that can be used to access, for example, a camera object. */ Q3DScene *QAbstract3DGraph::scene() const { diff --git a/src/datavisualization/input/qabstract3dinputhandler.cpp b/src/datavisualization/input/qabstract3dinputhandler.cpp index 5360eb38..9e1e314c 100644 --- a/src/datavisualization/input/qabstract3dinputhandler.cpp +++ b/src/datavisualization/input/qabstract3dinputhandler.cpp @@ -139,7 +139,7 @@ void QAbstract3DInputHandler::wheelEvent(QWheelEvent *event) * \property QAbstract3DInputHandler::inputView * * Current enumerated input view based on the view of the processed input events. - * When the view changes inputViewChanged() is emitted. + * When the view changes \c inputViewChanged signal is emitted. */ QAbstract3DInputHandler::InputView QAbstract3DInputHandler::inputView() const { -- cgit v1.2.3 From feec46ffea6f1cd39e679a9794c8c9159d2b25a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 27 Feb 2014 10:14:44 +0200 Subject: Doc fixes: - QCategory3DAxis - QBarDataProxy - QHeightMapSurfaceDataProxy - QItemModelBarDataProxy Change-Id: I021af6e0b52a6cc0b8068784406c3422e45640e1 Change-Id: I021af6e0b52a6cc0b8068784406c3422e45640e1 Reviewed-by: Miikka Heikkinen --- src/datavisualization/axis/qcategory3daxis.cpp | 4 ++-- src/datavisualization/data/qbardataproxy.cpp | 8 +++++--- .../data/qheightmapsurfacedataproxy.cpp | 15 +++++++------- .../data/qitemmodelbardataproxy.cpp | 24 +++++++++++----------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/datavisualization/axis/qcategory3daxis.cpp b/src/datavisualization/axis/qcategory3daxis.cpp index c1d5777a..c11a65eb 100644 --- a/src/datavisualization/axis/qcategory3daxis.cpp +++ b/src/datavisualization/axis/qcategory3daxis.cpp @@ -75,8 +75,8 @@ QCategory3DAxis::~QCategory3DAxis() /*! * \property QCategory3DAxis::labels * - * Defines labels for axis applied to categories. If there are fewer labels than categories, the - * remaining ones do not have a label. If category labels are not defined explicitly, labels are + * Defines \a labels for axis applied to categories. If there are fewer labels than categories, the + * remaining ones do not have a label. If category \a labels are not defined explicitly, labels are * generated from the data row (or column) labels of the primary series of the graph. */ QStringList QCategory3DAxis::labels() const diff --git a/src/datavisualization/data/qbardataproxy.cpp b/src/datavisualization/data/qbardataproxy.cpp index d2553f32..1c1170ff 100644 --- a/src/datavisualization/data/qbardataproxy.cpp +++ b/src/datavisualization/data/qbardataproxy.cpp @@ -49,12 +49,14 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \typedef QtDataVisualization::QBarDataRow + * \relates QBarDataProxy * * A vector of \l {QBarDataItem}s. */ /*! * \typedef QtDataVisualization::QBarDataArray + * \relates QBarDataProxy * * A list of pointers to \l {QBarDataRow}s. */ @@ -358,7 +360,7 @@ void QBarDataProxy::removeRows(int rowIndex, int removeCount, bool removeLabels) /*! * \property QBarDataProxy::rowCount * - * Row count in the array. + * Row \a count in the array. */ int QBarDataProxy::rowCount() const { @@ -368,7 +370,7 @@ int QBarDataProxy::rowCount() const /*! * \property QBarDataProxy::rowLabels * - * Optional row labels for the array. Indexes in this array match row indexes in data array. + * Optional row \a labels for the array. Indexes in this array match row indexes in data array. * If the list is shorter than row count, all rows will not get labels. */ QStringList QBarDataProxy::rowLabels() const @@ -387,7 +389,7 @@ void QBarDataProxy::setRowLabels(const QStringList &labels) /*! * \property QBarDataProxy::columnLabels * - * Optional column labels for the array. Indexes in this array match column indexes in rows. + * Optional column \a labels for the array. Indexes in this array match column indexes in rows. * If the list is shorter than the longest row, all columns will not get labels. */ QStringList QBarDataProxy::columnLabels() const diff --git a/src/datavisualization/data/qheightmapsurfacedataproxy.cpp b/src/datavisualization/data/qheightmapsurfacedataproxy.cpp index 1aead1d7..b7111afc 100644 --- a/src/datavisualization/data/qheightmapsurfacedataproxy.cpp +++ b/src/datavisualization/data/qheightmapsurfacedataproxy.cpp @@ -123,7 +123,7 @@ QHeightMapSurfaceDataProxy::QHeightMapSurfaceDataProxy(QObject *parent) : /*! * Constructs QHeightMapSurfaceDataProxy with the given \a image and \a parent. Height map is set - * by calling setHeighMap() with \a image. + * by calling setHeightMap() with \a image. * * \sa heightMap */ @@ -164,16 +164,17 @@ QHeightMapSurfaceDataProxy::~QHeightMapSurfaceDataProxy() /*! * \property QHeightMapSurfaceDataProxy::heightMap * - * A height map to be visualized. Setting this property replaces current data with height map data. + * A height map \a image to be visualized. Setting this property replaces current data with height + * map data. * - * There are several formats the image can be given in, but if it is not in a directly usable + * There are several formats the \a image can be given in, but if it is not in a directly usable * format, a conversion is made. \note If the result seems wrong, the automatic conversion failed - * and you should try converting the image yourself before setting it. Preferred format is + * and you should try converting the \a image yourself before setting it. Preferred format is * QImage::Format_RGB32 in grayscale. * - * The height of the image is read from the red component of the pixels if the image is in grayscale, - * otherwise it is an average calculated from red, green, and blue components of the pixels. Using - * grayscale images may improve data conversion speed for large images. + * The height of the \a image is read from the red component of the pixels if the \a image is in + * grayscale, otherwise it is an average calculated from red, green, and blue components of the + * pixels. Using grayscale images may improve data conversion speed for large images. * * Not recommended formats: all mono formats (for example QImage::Format_Mono). * diff --git a/src/datavisualization/data/qitemmodelbardataproxy.cpp b/src/datavisualization/data/qitemmodelbardataproxy.cpp index 0e880c77..4d220b13 100644 --- a/src/datavisualization/data/qitemmodelbardataproxy.cpp +++ b/src/datavisualization/data/qitemmodelbardataproxy.cpp @@ -125,21 +125,21 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty list ItemModelBarDataProxy::useModelCategories * When set to true, the mapping ignores row and column roles and categories, and uses * the rows and columns from the model instead. Row and column headers are used for row and column - * labels. Defaults to false. + * labels. Defaults to \c{false}. */ /*! * \qmlproperty list ItemModelBarDataProxy::autoRowCategories * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the - * data from the model is resolved. Defaults to true. + * data from the model is resolved. Defaults to \c{true}. */ /*! * \qmlproperty list ItemModelBarDataProxy::autoColumnCategories * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the - * data from model is resolved. Defaults to true. + * data from model is resolved. Defaults to \c{true}. */ /*! @@ -300,7 +300,7 @@ const QAbstractItemModel *QItemModelBarDataProxy::itemModel() const /*! * \property QItemModelBarDataProxy::rowRole * - * Defines the row role for the mapping. + * Defines the row \a role for the mapping. */ void QItemModelBarDataProxy::setRowRole(const QString &role) { @@ -318,7 +318,7 @@ QString QItemModelBarDataProxy::rowRole() const /*! * \property QItemModelBarDataProxy::columnRole * - * Defines the column role for the mapping. + * Defines the column \a role for the mapping. */ void QItemModelBarDataProxy::setColumnRole(const QString &role) { @@ -336,7 +336,7 @@ QString QItemModelBarDataProxy::columnRole() const /*! * \property QItemModelBarDataProxy::valueRole * - * Defines the value role for the mapping. + * Defines the value \a role for the mapping. */ void QItemModelBarDataProxy::setValueRole(const QString &role) { @@ -354,7 +354,7 @@ QString QItemModelBarDataProxy::valueRole() const /*! * \property QItemModelBarDataProxy::rotationRole * - * Defines the rotation role for the mapping. + * Defines the rotation \a role for the mapping. */ void QItemModelBarDataProxy::setRotationRole(const QString &role) { @@ -372,7 +372,7 @@ QString QItemModelBarDataProxy::rotationRole() const /*! * \property QItemModelBarDataProxy::rowCategories * - * Defines the row categories for the mapping. + * Defines the row \a categories for the mapping. */ void QItemModelBarDataProxy::setRowCategories(const QStringList &categories) { @@ -390,7 +390,7 @@ QStringList QItemModelBarDataProxy::rowCategories() const /*! * \property QItemModelBarDataProxy::columnCategories * - * Defines the column categories for the mapping. + * Defines the column \a categories for the mapping. */ void QItemModelBarDataProxy::setColumnCategories(const QStringList &categories) { @@ -409,7 +409,7 @@ QStringList QItemModelBarDataProxy::columnCategories() const * \property QItemModelBarDataProxy::useModelCategories * * When set to true, the mapping ignores row and column roles and categories, and uses - * the rows and columns from the model instead. Defaults to false. + * the rows and columns from the model instead. Defaults to \c{false}. */ void QItemModelBarDataProxy::setUseModelCategories(bool enable) { @@ -429,7 +429,7 @@ bool QItemModelBarDataProxy::useModelCategories() const * * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the - * data from model is resolved. Defaults to true. + * data from model is resolved. Defaults to \c{true}. */ void QItemModelBarDataProxy::setAutoRowCategories(bool enable) { @@ -449,7 +449,7 @@ bool QItemModelBarDataProxy::autoRowCategories() const * * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the - * data from model is resolved. Defaults to true. + * data from model is resolved. Defaults to \c{true}. */ void QItemModelBarDataProxy::setAutoColumnCategories(bool enable) { -- cgit v1.2.3 From 0d36ea419c1cae70a896babebffe0e6af9a60bca Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 27 Feb 2014 10:41:03 +0200 Subject: Fix some docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I468611f1cf9d130bc2b5bcba63e24a2fafecbaca Reviewed-by: Tomi Korpipää --- src/datavisualization/doc/src/qtdatavisualization-index.qdoc | 1 - src/datavisualization/doc/src/qtdatavisualization.qdoc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/datavisualization/doc/src/qtdatavisualization-index.qdoc b/src/datavisualization/doc/src/qtdatavisualization-index.qdoc index d593c1e9..2190dbc3 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-index.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-index.qdoc @@ -33,7 +33,6 @@ \li QML2 support \li Customizable axes for data - control viewable data window with axis ranges \li Customizable input handling - \li Customizable scene handling \li Customizable themes \endlist diff --git a/src/datavisualization/doc/src/qtdatavisualization.qdoc b/src/datavisualization/doc/src/qtdatavisualization.qdoc index e68a1086..f8d3178d 100644 --- a/src/datavisualization/doc/src/qtdatavisualization.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization.qdoc @@ -138,7 +138,7 @@ \section1 Running examples Qt Data Visualization examples are found under the \c examples subdirectory. To build and run a - single example, for example, the qmlsurface example, navigate to the example directory and enter the + single example, in this case qmlsurface, navigate to the example directory and enter the following commands: \snippet doc_src_qtdatavisualization.cpp 8 -- cgit v1.2.3 From f27ec02cee6e0390ec92e82e442cbe3cb12726a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 27 Feb 2014 11:08:10 +0200 Subject: Doc fixes: - QValue3DAxis - QItemModelScatterDataProxy - QItemModelSurfaceDataProxy - QScatterDataProxy - QSurface3DSeries - QSurfaceDataProxy Change-Id: If94fef980c96d4e34a5034ba93f3ac676d479f05 Change-Id: If94fef980c96d4e34a5034ba93f3ac676d479f05 Reviewed-by: Miikka Heikkinen --- src/datavisualization/axis/qvalue3daxis.cpp | 2 +- .../data/qitemmodelscatterdataproxy.cpp | 14 ++++++------ .../data/qitemmodelsurfacedataproxy.cpp | 26 +++++++++++----------- src/datavisualization/data/qscatterdataproxy.cpp | 1 + src/datavisualization/data/qsurface3dseries.cpp | 4 ++-- src/datavisualization/data/qsurface3dseries.h | 2 +- src/datavisualization/data/qsurfacedataproxy.cpp | 2 ++ 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/datavisualization/axis/qvalue3daxis.cpp b/src/datavisualization/axis/qvalue3daxis.cpp index 52f1e599..0d53291d 100644 --- a/src/datavisualization/axis/qvalue3daxis.cpp +++ b/src/datavisualization/axis/qvalue3daxis.cpp @@ -147,7 +147,7 @@ int QValue3DAxis::subSegmentCount() const /*! * \property QValue3DAxis::labelFormat * - * Defines the label format to be used for the labels on this axis. Supported specifiers are: + * Defines the label \a format to be used for the labels on this axis. Supported specifiers are: * \c {d, i, o, x, X, f, F, e, E, g, G, c}. See QString::sprintf() for additional details. * * Usage example: diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp index a5287abc..c4924886 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp +++ b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp @@ -190,7 +190,7 @@ const QAbstractItemModel *QItemModelScatterDataProxy::itemModel() const /*! * \property QItemModelScatterDataProxy::xPosRole * - * Defines the X position role for the mapping. + * Defines the X position \a role for the mapping. */ void QItemModelScatterDataProxy::setXPosRole(const QString &role) { @@ -208,7 +208,7 @@ QString QItemModelScatterDataProxy::xPosRole() const /*! * \property QItemModelScatterDataProxy::yPosRole * - * Defines the Y position role for the mapping. + * Defines the Y position \a role for the mapping. */ void QItemModelScatterDataProxy::setYPosRole(const QString &role) { @@ -226,7 +226,7 @@ QString QItemModelScatterDataProxy::yPosRole() const /*! * \property QItemModelScatterDataProxy::zPosRole * - * Defines the Z position role for the mapping. + * Defines the Z position \a role for the mapping. */ void QItemModelScatterDataProxy::setZPosRole(const QString &role) { @@ -244,12 +244,12 @@ QString QItemModelScatterDataProxy::zPosRole() const /*! * \property QItemModelScatterDataProxy::rotationRole * - * Defines the rotation role for the mapping. + * Defines the rotation \a role for the mapping. * * The model may supply the value for rotation as either variant that is directly convertible - * to QQuartenion, or as one of the string representations: \c{"scalar,x,y,z"} or \c{"@angle,x,y,z"}. The first - * will construct the quaternion directly with given values, and the second one will construct - * the quaternion using QQuaternion::fromAxisAndAngle() method. + * to QQuaternion, or as one of the string representations: \c{"scalar,x,y,z"} or \c{"@angle,x,y,z"}. + * The first will construct the quaternion directly with given values, and the second one will + * construct the quaternion using QQuaternion::fromAxisAndAngle() method. */ void QItemModelScatterDataProxy::setRotationRole(const QString &role) { diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp index f15a8923..07d15d23 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp @@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty list ItemModelSurfaceDataProxy::useModelCategories * When set to true, the mapping ignores row and column roles and categories, and uses - * the rows and columns from the model instead. Defaults to false. + * the rows and columns from the model instead. Defaults to \c{false}. */ /*! @@ -145,7 +145,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the * data from model is resolved. Proxy minimum and maximum row values are also - * autogenerated from data when this is set to true. Defaults to true. + * autogenerated from data when this is set to true. Defaults to \c{true}. */ /*! @@ -153,7 +153,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the * data from model is resolved. Proxy minimum and maximum column values are also - * autogenerated from data when this is set to true. Defaults to true. + * autogenerated from data when this is set to true. Defaults to \c{true}. */ /*! @@ -329,7 +329,7 @@ const QAbstractItemModel *QItemModelSurfaceDataProxy::itemModel() const /*! * \property QItemModelSurfaceDataProxy::rowRole * - * Defines the row role for the mapping. + * Defines the row \a role for the mapping. */ void QItemModelSurfaceDataProxy::setRowRole(const QString &role) { @@ -347,7 +347,7 @@ QString QItemModelSurfaceDataProxy::rowRole() const /*! * \property QItemModelSurfaceDataProxy::columnRole * - * Defines the column role for the mapping. + * Defines the column \a role for the mapping. */ void QItemModelSurfaceDataProxy::setColumnRole(const QString &role) { @@ -365,7 +365,7 @@ QString QItemModelSurfaceDataProxy::columnRole() const /*! * \property QItemModelSurfaceDataProxy::xPosRole * - * Defines the X position role for the mapping. + * Defines the X position \a role for the mapping. */ void QItemModelSurfaceDataProxy::setXPosRole(const QString &role) { @@ -383,7 +383,7 @@ QString QItemModelSurfaceDataProxy::xPosRole() const /*! * \property QItemModelSurfaceDataProxy::yPosRole * - * Defines the Y position role for the mapping. + * Defines the Y position \a role for the mapping. */ void QItemModelSurfaceDataProxy::setYPosRole(const QString &role) { @@ -401,7 +401,7 @@ QString QItemModelSurfaceDataProxy::yPosRole() const /*! * \property QItemModelSurfaceDataProxy::zPosRole * - * Defines the Z position role for the mapping. + * Defines the Z position \a role for the mapping. */ void QItemModelSurfaceDataProxy::setZPosRole(const QString &role) { @@ -419,7 +419,7 @@ QString QItemModelSurfaceDataProxy::zPosRole() const /*! * \property QItemModelSurfaceDataProxy::rowCategories * - * Defines the row categories for the mapping. + * Defines the row \a categories for the mapping. */ void QItemModelSurfaceDataProxy::setRowCategories(const QStringList &categories) { @@ -437,7 +437,7 @@ QStringList QItemModelSurfaceDataProxy::rowCategories() const /*! * \property QItemModelSurfaceDataProxy::columnCategories * - * Defines the column categories for the mapping. + * Defines the column \a categories for the mapping. */ void QItemModelSurfaceDataProxy::setColumnCategories(const QStringList &categories) { @@ -456,7 +456,7 @@ QStringList QItemModelSurfaceDataProxy::columnCategories() const * \property QItemModelSurfaceDataProxy::useModelCategories * * When set to true, the mapping ignores row and column roles and categories, and uses - * the rows and columns from the model instead. Defaults to false. + * the rows and columns from the model instead. Defaults to \c{false}. */ void QItemModelSurfaceDataProxy::setUseModelCategories(bool enable) { @@ -476,7 +476,7 @@ bool QItemModelSurfaceDataProxy::useModelCategories() const * * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the - * data from model is resolved. Defaults to true. + * data from model is resolved. Defaults to \c{true}. */ void QItemModelSurfaceDataProxy::setAutoRowCategories(bool enable) { @@ -496,7 +496,7 @@ bool QItemModelSurfaceDataProxy::autoRowCategories() const * * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the - * data from model is resolved. Defaults to true. + * data from model is resolved. Defaults to \c{true}. */ void QItemModelSurfaceDataProxy::setAutoColumnCategories(bool enable) { diff --git a/src/datavisualization/data/qscatterdataproxy.cpp b/src/datavisualization/data/qscatterdataproxy.cpp index dbbb4384..84bb57e7 100644 --- a/src/datavisualization/data/qscatterdataproxy.cpp +++ b/src/datavisualization/data/qscatterdataproxy.cpp @@ -37,6 +37,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \typedef QtDataVisualization::QScatterDataArray + * \relates QScatterDataProxy * * A vector of \l {QScatterDataItem}s. */ diff --git a/src/datavisualization/data/qsurface3dseries.cpp b/src/datavisualization/data/qsurface3dseries.cpp index b7e15014..9518b0c4 100644 --- a/src/datavisualization/data/qsurface3dseries.cpp +++ b/src/datavisualization/data/qsurface3dseries.cpp @@ -283,9 +283,9 @@ bool QSurface3DSeries::isFlatShadingSupported() const /*! * \property QSurface3DSeries::drawMode * - * Sets the drawing \a mode to one of QSurface3DSeries::DrawFlag. + * Sets the drawing \a mode to one of DrawFlag. */ -void QSurface3DSeries::setDrawMode(QSurface3DSeries::DrawFlags mode) +void QSurface3DSeries::setDrawMode(DrawFlags mode) { if (dptr()->m_drawMode != mode) { dptr()->setDrawMode(mode); diff --git a/src/datavisualization/data/qsurface3dseries.h b/src/datavisualization/data/qsurface3dseries.h index 8347104e..64df7202 100644 --- a/src/datavisualization/data/qsurface3dseries.h +++ b/src/datavisualization/data/qsurface3dseries.h @@ -58,7 +58,7 @@ public: void setFlatShadingEnabled(bool enabled); bool isFlatShadingEnabled() const; - void setDrawMode(QSurface3DSeries::DrawFlags mode); + void setDrawMode(DrawFlags mode); QSurface3DSeries::DrawFlags drawMode() const; bool isFlatShadingSupported() const; diff --git a/src/datavisualization/data/qsurfacedataproxy.cpp b/src/datavisualization/data/qsurfacedataproxy.cpp index 34cea326..2e66bb5b 100644 --- a/src/datavisualization/data/qsurfacedataproxy.cpp +++ b/src/datavisualization/data/qsurfacedataproxy.cpp @@ -58,12 +58,14 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \typedef QtDataVisualization::QSurfaceDataRow + * \relates QSurfaceDataProxy * * A vector of \l {QSurfaceDataItem}s. */ /*! * \typedef QtDataVisualization::QSurfaceDataArray + * \relates QSurfaceDataProxy * * A list of pointers to \l {QSurfaceDataRow}s. */ -- cgit v1.2.3 From 34a7223467a45e33c1b344f1e1880bc818b66b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 28 Feb 2014 10:03:52 +0200 Subject: Fixed touch selection bug Task-number: QTRD-2904 Change-Id: Ia6a0de9fd8a6b3cd42bd6512227033218162b2c0 Reviewed-by: Mika Salmela --- src/datavisualization/input/qtouch3dinputhandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/datavisualization/input/qtouch3dinputhandler.cpp b/src/datavisualization/input/qtouch3dinputhandler.cpp index da84b33f..fc398e81 100644 --- a/src/datavisualization/input/qtouch3dinputhandler.cpp +++ b/src/datavisualization/input/qtouch3dinputhandler.cpp @@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION const float maxTapAndHoldJitter = 20.0f; const int maxPinchJitter = 10; -#if defined (Q_OS_ANDROID) +#if defined (Q_OS_ANDROID) or defined(Q_OS_IOS) const int maxSelectionJitter = 10; #else const int maxSelectionJitter = 5; @@ -102,6 +102,8 @@ void QTouch3DInputHandler::touchEvent(QTouchEvent *event) } else if (points.count() == 1) { QPointF pointerPos = points.at(0).pos(); if (event->type() == QEvent::TouchBegin) { + // Flush input state + d_ptr->m_inputState = QAbstract3DInputHandlerPrivate::InputStateNone; if (scene()->isSlicingActive()) { if (scene()->isPointInPrimarySubView(pointerPos.toPoint())) setInputView(InputViewOnPrimary); @@ -123,7 +125,8 @@ void QTouch3DInputHandler::touchEvent(QTouchEvent *event) setInputView(InputViewNone); d_ptr->m_holdTimer->stop(); // Handle possible selection - if (QAbstract3DInputHandlerPrivate::InputStatePinching != d_ptr->m_inputState) + if (!scene()->isSlicingActive() + && QAbstract3DInputHandlerPrivate::InputStatePinching != d_ptr->m_inputState) d_ptr->handleSelection(pointerPos); } else if (event->type() == QEvent::TouchUpdate) { if (!scene()->isSlicingActive()) { -- cgit v1.2.3 From 86b4e19ee160ee3e84210595db5e6af08a8b9e46 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 27 Feb 2014 11:23:17 +0200 Subject: Introduce state storing for mac and android. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least some mac and android environments do not handle shared contexts properly, leading to slowdowns and/or artifacts. Disable context sharing on mac and android, and instead store and restore relevant opengl state. Also improve renderer and context cleanup Change-Id: I8fa596b95f6ff20d53c950a34b5c28513acbc18f Reviewed-by: Tomi Korpipää --- .../engine/abstract3dcontroller.cpp | 10 +- .../engine/abstract3dcontroller_p.h | 1 + src/datavisualization/engine/qabstract3dgraph.cpp | 3 + src/datavisualizationqml2/abstractdeclarative.cpp | 96 ++++- src/datavisualizationqml2/abstractdeclarative_p.h | 21 +- .../datavisualizationqml2.pro | 8 +- src/datavisualizationqml2/enumtostringmap.cpp | 393 +++++++++++++++++++++ src/datavisualizationqml2/enumtostringmap_p.h | 49 +++ src/datavisualizationqml2/glstatestore.cpp | 377 ++++++++++++++++++++ src/datavisualizationqml2/glstatestore_p.h | 99 ++++++ 10 files changed, 1033 insertions(+), 24 deletions(-) create mode 100644 src/datavisualizationqml2/enumtostringmap.cpp create mode 100644 src/datavisualizationqml2/enumtostringmap_p.h create mode 100644 src/datavisualizationqml2/glstatestore.cpp create mode 100644 src/datavisualizationqml2/glstatestore_p.h diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index d2b59c58..acb63f0a 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -80,14 +80,20 @@ Abstract3DController::Abstract3DController(QRect initialViewport, Q3DScene *scen } Abstract3DController::~Abstract3DController() +{ + destroyRenderer(); + delete m_scene; + delete m_themeManager; +} + +void Abstract3DController::destroyRenderer() { // Renderer can be in another thread, don't delete it directly in that case if (m_renderer && m_renderer->thread() != QThread::currentThread()) m_renderer->deleteLater(); else delete m_renderer; - delete m_scene; - delete m_themeManager; + m_renderer = 0; } /** diff --git a/src/datavisualization/engine/abstract3dcontroller_p.h b/src/datavisualization/engine/abstract3dcontroller_p.h index f9b6588d..5bae17d6 100644 --- a/src/datavisualization/engine/abstract3dcontroller_p.h +++ b/src/datavisualization/engine/abstract3dcontroller_p.h @@ -161,6 +161,7 @@ public: virtual ~Abstract3DController(); inline bool isInitialized() { return (m_renderer != 0); } + virtual void destroyRenderer(); virtual void synchDataToRenderer(); virtual void render(const GLuint defaultFboHandle = 0); virtual void initializeOpenGL() = 0; diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index 1551c639..cce2c235 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -450,6 +450,9 @@ QAbstract3DGraphPrivate::QAbstract3DGraphPrivate(QAbstract3DGraph *q) QAbstract3DGraphPrivate::~QAbstract3DGraphPrivate() { + if (m_context) + m_context->makeCurrent(q_ptr); + delete m_visualController; } diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp index ce74d541..e7a5c7eb 100644 --- a/src/datavisualizationqml2/abstractdeclarative.cpp +++ b/src/datavisualizationqml2/abstractdeclarative.cpp @@ -21,7 +21,6 @@ #include "declarativetheme_p.h" #include "declarativerendernode_p.h" -#include #include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -33,8 +32,6 @@ static QHash windowClearList; AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : QQuickItem(parent), m_controller(0), - m_context(0), - m_qtContext(0), m_contextWindow(0), m_renderMode(RenderIndirect), #if defined(QT_OPENGL_ES_2) @@ -43,7 +40,15 @@ AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : m_samples(4), #endif m_windowSamples(0), - m_initialisedSize(0, 0) + m_initialisedSize(0, 0), +#ifdef USE_SHARED_CONTEXT + m_context(0), +#else + m_stateStore(0), +#endif + m_qtContext(0), + m_mainThread(QThread::currentThread()), + m_contextThread(0) { connect(this, &QQuickItem::windowChanged, this, &AbstractDeclarative::handleWindowChanged); setAntialiasing(m_samples > 0); @@ -54,12 +59,23 @@ AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : AbstractDeclarative::~AbstractDeclarative() { -#if !defined(Q_OS_MAC) +#ifdef USE_SHARED_CONTEXT // Context can be in another thread, don't delete it directly in that case - if (m_context && m_context->thread() != QThread::currentThread()) - m_context->deleteLater(); - else + if (m_contextThread && m_contextThread != m_mainThread) { + if (m_context) + m_context->deleteLater(); + m_context = 0; + } else { delete m_context; + } +#else + if (m_contextThread && m_contextThread != m_mainThread) { + if (m_stateStore) + m_stateStore->deleteLater(); + m_stateStore = 0; + } else { + delete m_stateStore; + } #endif disconnect(this, 0, this, 0); @@ -216,28 +232,75 @@ void AbstractDeclarative::setSharedController(Abstract3DController *controller) void AbstractDeclarative::activateOpenGLContext(QQuickWindow *window) { -#if !defined(Q_OS_MAC) - if (!m_context || m_contextWindow != window) { - m_contextWindow = window; +#ifdef USE_SHARED_CONTEXT + // We can assume we are not in middle of AbstractDeclarative destructor when we are here, + // since m_context creation is always done when this function is called from + // synchDataToRenderer(), which blocks main thread -> no need to mutex. + if (!m_context || !m_qtContext || m_contextWindow != window) { + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + + if (m_context && currentContext != m_qtContext) { + // If Qt context has changed, the old renderer needs to go. + // If the old context window no longer exists, it is okay to delete renderer + // in null context, as we can assume Qt context for the window is also gone. + m_context->makeCurrent(m_contextWindow); + m_controller->destroyRenderer(); + m_context->doneCurrent(); // So that we don't delete active context + } + delete m_context; - m_qtContext = QOpenGLContext::currentContext(); + + m_contextThread = QThread::currentThread(); + m_contextWindow = window; + m_qtContext = currentContext; + m_context = new QOpenGLContext(); - m_context->setFormat(window->requestedFormat()); + m_context->setFormat(m_qtContext->format()); m_context->setShareContext(m_qtContext); m_context->create(); + + m_context->makeCurrent(window); + m_controller->initializeOpenGL(); + } else { + m_context->makeCurrent(window); } - m_context->makeCurrent(window); #else - Q_UNUSED(window) + // Shared contexts don't work properly in some platforms, so just store the + // context state on those + if (!m_stateStore || !m_qtContext || m_contextWindow != window) { + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + + if (m_qtContext && currentContext != m_qtContext) { + // If Qt context has changed but still exists, the old renderer needs to go. + // If the old context window no longer exists, it is okay to delete renderer + // in null context (though it is likely Qt context is gone in that case, too.) + m_qtContext->makeCurrent(m_contextWindow); + m_controller->destroyRenderer(); + currentContext->makeCurrent(window); + } + + m_contextThread = QThread::currentThread(); + m_contextWindow = window; + m_qtContext = currentContext; + + delete m_stateStore; + m_stateStore = new GLStateStore(QOpenGLContext::currentContext()); + + m_stateStore->storeGLState(); + m_controller->initializeOpenGL(); + } else { + m_stateStore->storeGLState(); + } #endif } void AbstractDeclarative::doneOpenGLContext(QQuickWindow *window) { -#if !defined(Q_OS_MAC) +#ifdef USE_SHARED_CONTEXT m_qtContext->makeCurrent(window); #else Q_UNUSED(window) + m_stateStore->restoreGLState(); #endif } @@ -248,7 +311,6 @@ void AbstractDeclarative::synchDataToRenderer() QQuickWindow *win = window(); activateOpenGLContext(win); - m_controller->initializeOpenGL(); m_controller->synchDataToRenderer(); doneOpenGLContext(win); } diff --git a/src/datavisualizationqml2/abstractdeclarative_p.h b/src/datavisualizationqml2/abstractdeclarative_p.h index d44a154d..ac8bf9be 100644 --- a/src/datavisualizationqml2/abstractdeclarative_p.h +++ b/src/datavisualizationqml2/abstractdeclarative_p.h @@ -29,15 +29,24 @@ #ifndef ABSTRACTDECLARATIVE_P_H #define ABSTRACTDECLARATIVE_P_H +#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) +#define USE_SHARED_CONTEXT +#endif + #include "datavisualizationglobal_p.h" #include "abstract3dcontroller_p.h" #include "qabstract3dinputhandler.h" #include "declarativescene_p.h" +#ifndef USE_SHARED_CONTEXT +#include "glstatestore_p.h" +#endif + #include #include #include #include +#include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -158,13 +167,19 @@ signals: private: QPointer m_controller; QRectF m_cachedGeometry; - QOpenGLContext *m_context; - QOpenGLContext *m_qtContext; - QQuickWindow *m_contextWindow; + QPointer m_contextWindow; AbstractDeclarative::RenderingMode m_renderMode; int m_samples; int m_windowSamples; QSize m_initialisedSize; +#ifdef USE_SHARED_CONTEXT + QOpenGLContext *m_context; +#else + GLStateStore *m_stateStore; +#endif + QPointer m_qtContext; + QThread *m_mainThread; + QThread *m_contextThread; }; Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractDeclarative::SelectionFlags) diff --git a/src/datavisualizationqml2/datavisualizationqml2.pro b/src/datavisualizationqml2/datavisualizationqml2.pro index df6c647d..ed91b111 100644 --- a/src/datavisualizationqml2/datavisualizationqml2.pro +++ b/src/datavisualizationqml2/datavisualizationqml2.pro @@ -26,7 +26,9 @@ SOURCES += \ declarativetheme.cpp \ declarativecolor.cpp \ declarativescene.cpp \ - declarativerendernode.cpp + declarativerendernode.cpp \ + glstatestore.cpp \ + enumtostringmap.cpp HEADERS += \ datavisualizationqml2_plugin.h \ @@ -39,7 +41,9 @@ HEADERS += \ declarativetheme_p.h \ declarativecolor_p.h \ declarativescene_p.h \ - declarativerendernode_p.h + declarativerendernode_p.h \ + glstatestore_p.h \ + enumtostringmap_p.h OTHER_FILES = qmldir diff --git a/src/datavisualizationqml2/enumtostringmap.cpp b/src/datavisualizationqml2/enumtostringmap.cpp new file mode 100644 index 00000000..fd68c6bb --- /dev/null +++ b/src/datavisualizationqml2/enumtostringmap.cpp @@ -0,0 +1,393 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ +#include "enumtostringmap_p.h" +#include +#include + +static EnumToStringMap *theInstance = 0; +static unsigned int theInstanceCount = 0; + +EnumToStringMap *EnumToStringMap::newInstance() +{ + if (theInstance) { + theInstanceCount++; + return theInstance; + } + + theInstance = new EnumToStringMap(); + theInstanceCount++; + return theInstance; +} + +void EnumToStringMap::deleteInstance() +{ + theInstanceCount--; + if (theInstanceCount <= 0) { + delete theInstance; + theInstance = 0; + } +} + +EnumToStringMap::EnumToStringMap() : + m_unknown("") +{ + m_map[GL_ZERO] = "ZERO/null"; + + m_map[GL_DEPTH_BUFFER_BIT] = "DEPTH_BUFFER_BIT"; + m_map[GL_STENCIL_BUFFER_BIT] = "STENCIL_BUFFER_BIT"; + m_map[GL_COLOR_BUFFER_BIT] = "COLOR_BUFFER_BIT"; + + m_map[GL_STENCIL_BUFFER_BIT] = "STENCIL_BUFFER_BIT"; + m_map[GL_COLOR_BUFFER_BIT] = "COLOR_BUFFER_BIT"; + + m_map[GL_POINTS] = "POINTS"; + m_map[GL_LINES] = "LINES"; + m_map[GL_LINE_LOOP] = "LINE_LOOP"; + m_map[GL_LINE_STRIP] = "LINE_STRIP"; + m_map[GL_TRIANGLES] = "TRIANGLES"; + m_map[GL_TRIANGLE_STRIP] = "TRIANGLE_STRIP"; + m_map[GL_TRIANGLE_FAN] = "TRIANGLE_FAN"; + + m_map[GL_SRC_COLOR] = "SRC_COLOR"; + m_map[GL_ONE_MINUS_SRC_COLOR] = "ONE_MINUS_SRC_COLOR"; + m_map[GL_SRC_ALPHA] = "SRC_ALPHA"; + m_map[GL_ONE_MINUS_SRC_ALPHA] = "ONE_MINUS_SRC_ALPHA"; + m_map[GL_DST_ALPHA] = "DST_ALPHA"; + m_map[GL_ONE_MINUS_DST_ALPHA] = "ONE_MINUS_DST_ALPHA"; + + m_map[GL_DST_COLOR] = "DST_COLOR"; + m_map[GL_ONE_MINUS_DST_COLOR] = "ONE_MINUS_DST_COLOR"; + m_map[GL_SRC_ALPHA_SATURATE] = "SRC_ALPHA_SATURATE"; + + m_map[GL_FUNC_ADD] = "FUNC_ADD"; + m_map[GL_BLEND_EQUATION] = "BLEND_EQUATION"; + m_map[GL_BLEND_EQUATION_RGB] = "BLEND_EQUATION_RGB"; + m_map[GL_BLEND_EQUATION_ALPHA] = "BLEND_EQUATION_ALPHA"; + + m_map[GL_FUNC_SUBTRACT] = "FUNC_SUBTRACT"; + m_map[GL_FUNC_REVERSE_SUBTRACT] = "FUNC_REVERSE_SUBTRACT"; + + m_map[GL_BLEND_DST_RGB] = "BLEND_DST_RGB"; + m_map[GL_BLEND_SRC_RGB] = "BLEND_SRC_RGB"; + m_map[GL_BLEND_DST_ALPHA] = "BLEND_DST_ALPHA"; + m_map[GL_BLEND_SRC_ALPHA] = "BLEND_SRC_ALPHA"; + m_map[GL_CONSTANT_COLOR] = "CONSTANT_COLOR"; + m_map[GL_ONE_MINUS_CONSTANT_COLOR] = "ONE_MINUS_CONSTANT_COLOR"; + m_map[GL_CONSTANT_ALPHA] = "CONSTANT_ALPHA"; + m_map[GL_ONE_MINUS_CONSTANT_ALPHA] = "ONE_MINUS_CONSTANT_ALPHA"; + m_map[GL_BLEND_COLOR] = "BLEND_COLOR"; + + m_map[GL_ARRAY_BUFFER] = "ARRAY_BUFFER"; + m_map[GL_ELEMENT_ARRAY_BUFFER] = "ELEMENT_ARRAY_BUFFER"; + m_map[GL_ARRAY_BUFFER_BINDING] = "ARRAY_BUFFER_BINDING"; + m_map[GL_ELEMENT_ARRAY_BUFFER_BINDING] = "ELEMENT_ARRAY_BUFFER_BINDING"; + + m_map[GL_STREAM_DRAW] = "STREAM_DRAW"; + m_map[GL_STATIC_DRAW] = "STATIC_DRAW"; + m_map[GL_DYNAMIC_DRAW] = "DYNAMIC_DRAW"; + + m_map[GL_BUFFER_SIZE] = "BUFFER_SIZE"; + m_map[GL_BUFFER_USAGE] = "BUFFER_USAGE"; + + m_map[GL_CURRENT_VERTEX_ATTRIB] = "CURRENT_VERTEX_ATTRIB"; + + m_map[GL_FRONT] = "FRONT"; + m_map[GL_BACK] = "BACK"; + m_map[GL_FRONT_AND_BACK] = "FRONT_AND_BACK"; + + m_map[GL_CULL_FACE] = "CULL_FACE"; + m_map[GL_BLEND] = "BLEND"; + m_map[GL_DITHER] = "DITHER"; + m_map[GL_STENCIL_TEST] = "STENCIL_TEST"; + m_map[GL_DEPTH_TEST] = "DEPTH_TEST"; + m_map[GL_SCISSOR_TEST] = "SCISSOR_TEST"; + m_map[GL_POLYGON_OFFSET_FILL] = "POLYGON_OFFSET_FILL"; + m_map[GL_SAMPLE_ALPHA_TO_COVERAGE] = "SAMPLE_ALPHA_TO_COVERAGE"; + m_map[GL_SAMPLE_COVERAGE] = "SAMPLE_COVERAGE"; + + m_map[GL_NO_ERROR] = "NO_ERROR"; + m_map[GL_INVALID_ENUM] = "INVALID_ENUM"; + m_map[GL_INVALID_VALUE] = "INVALID_VALUE"; + m_map[GL_INVALID_OPERATION] = "INVALID_OPERATION"; + m_map[GL_OUT_OF_MEMORY] = "OUT_OF_MEMORY"; + + m_map[GL_CW] = "CW"; + m_map[GL_CCW] = "CCW"; + + m_map[GL_LINE_WIDTH] = "LINE_WIDTH"; + m_map[GL_ALIASED_POINT_SIZE_RANGE] = "ALIASED_POINT_SIZE_RANGE"; + m_map[GL_ALIASED_LINE_WIDTH_RANGE] = "ALIASED_LINE_WIDTH_RANGE"; + m_map[GL_CULL_FACE_MODE] = "CULL_FACE_MODE"; + m_map[GL_FRONT_FACE] = "FRONT_FACE"; + m_map[GL_DEPTH_RANGE] = "DEPTH_RANGE"; + m_map[GL_DEPTH_WRITEMASK] = "DEPTH_WRITEMASK"; + m_map[GL_DEPTH_CLEAR_VALUE] = "DEPTH_CLEAR_VALUE"; + m_map[GL_DEPTH_FUNC] = "DEPTH_FUNC"; + m_map[GL_STENCIL_CLEAR_VALUE] = "STENCIL_CLEAR_VALUE"; + m_map[GL_STENCIL_FUNC] = "STENCIL_FUNC"; + m_map[GL_STENCIL_FAIL] = "STENCIL_FAIL"; + m_map[GL_STENCIL_PASS_DEPTH_FAIL] = "STENCIL_PASS_DEPTH_FAIL"; + m_map[GL_STENCIL_PASS_DEPTH_PASS] = "STENCIL_PASS_DEPTH_PASS"; + m_map[GL_STENCIL_REF] = "STENCIL_REF"; + m_map[GL_STENCIL_VALUE_MASK] = "STENCIL_VALUE_MASK"; + m_map[GL_STENCIL_WRITEMASK] = "STENCIL_WRITEMASK"; + m_map[GL_STENCIL_BACK_FUNC] = "STENCIL_BACK_FUNC"; + m_map[GL_STENCIL_BACK_FAIL] = "STENCIL_BACK_FAIL"; + m_map[GL_STENCIL_BACK_PASS_DEPTH_FAIL] = "STENCIL_BACK_PASS_DEPTH_FAIL"; + m_map[GL_STENCIL_BACK_PASS_DEPTH_PASS] = "STENCIL_BACK_PASS_DEPTH_PASS"; + m_map[GL_STENCIL_BACK_REF] = "STENCIL_BACK_REF"; + m_map[GL_STENCIL_BACK_VALUE_MASK] = "STENCIL_BACK_VALUE_MASK"; + m_map[GL_STENCIL_BACK_WRITEMASK] = "STENCIL_BACK_WRITEMASK"; + m_map[GL_VIEWPORT] = "VIEWPORT"; + m_map[GL_SCISSOR_BOX] = "SCISSOR_BOX"; + + m_map[GL_COLOR_CLEAR_VALUE] = "COLOR_CLEAR_VALUE"; + m_map[GL_COLOR_WRITEMASK] = "COLOR_WRITEMASK"; + m_map[GL_UNPACK_ALIGNMENT] = "UNPACK_ALIGNMENT"; + m_map[GL_PACK_ALIGNMENT] = "PACK_ALIGNMENT"; + m_map[GL_MAX_TEXTURE_SIZE] = "MAX_TEXTURE_SIZE"; + m_map[GL_MAX_VIEWPORT_DIMS] = "MAX_VIEWPORT_DIMS"; + m_map[GL_SUBPIXEL_BITS] = "SUBPIXEL_BITS"; + m_map[GL_RED_BITS] = "RED_BITS"; + m_map[GL_GREEN_BITS] = "GREEN_BITS"; + m_map[GL_BLUE_BITS] = "BLUE_BITS"; + m_map[GL_ALPHA_BITS] = "ALPHA_BITS"; + m_map[GL_DEPTH_BITS] = "DEPTH_BITS"; + m_map[GL_STENCIL_BITS] = "STENCIL_BITS"; + m_map[GL_POLYGON_OFFSET_UNITS] = "POLYGON_OFFSET_UNITS"; + + m_map[GL_POLYGON_OFFSET_FACTOR] = "POLYGON_OFFSET_FACTOR"; + m_map[GL_TEXTURE_BINDING_2D] = "TEXTURE_BINDING_2D"; + m_map[GL_SAMPLE_BUFFERS] = "SAMPLE_BUFFERS"; + m_map[GL_SAMPLES] = "SAMPLES"; + m_map[GL_SAMPLE_COVERAGE_VALUE] = "SAMPLE_COVERAGE_VALUE"; + m_map[GL_SAMPLE_COVERAGE_INVERT] = "SAMPLE_COVERAGE_INVERT"; + + m_map[GL_COMPRESSED_TEXTURE_FORMATS] = "COMPRESSED_TEXTURE_FORMATS"; + + m_map[GL_DONT_CARE] = "DONT_CARE"; + m_map[GL_FASTEST] = "FASTEST"; + m_map[GL_NICEST] = "NICEST"; + + m_map[GL_GENERATE_MIPMAP_HINT] = "GENERATE_MIPMAP_HINT"; + + m_map[GL_BYTE] = "BYTE"; + m_map[GL_UNSIGNED_BYTE] = "UNSIGNED_BYTE"; + m_map[GL_SHORT] = "SHORT"; + m_map[GL_UNSIGNED_SHORT] = "UNSIGNED_SHORT"; + m_map[GL_INT] = "INT"; + m_map[GL_UNSIGNED_INT] = "UNSIGNED_INT"; + m_map[GL_FLOAT] = "FLOAT"; + + m_map[GL_DEPTH_COMPONENT] = "DEPTH_COMPONENT"; + m_map[GL_ALPHA] = "ALPHA"; + m_map[GL_RGB] = "RGB"; + m_map[GL_RGBA] = "RGBA"; + m_map[GL_LUMINANCE] = "LUMINANCE"; + m_map[GL_LUMINANCE_ALPHA] = "LUMINANCE_ALPHA"; + + m_map[GL_UNSIGNED_SHORT_4_4_4_4] = "UNSIGNED_SHORT_4_4_4_4"; + m_map[GL_UNSIGNED_SHORT_5_5_5_1] = "UNSIGNED_SHORT_5_5_5_1"; + m_map[GL_UNSIGNED_SHORT_5_6_5] = "UNSIGNED_SHORT_5_6_5"; + + m_map[GL_FRAGMENT_SHADER] = "FRAGMENT_SHADER"; + m_map[GL_VERTEX_SHADER] = "VERTEX_SHADER"; + m_map[GL_MAX_VERTEX_ATTRIBS] = "MAX_VERTEX_ATTRIBS"; + m_map[GL_MAX_VERTEX_UNIFORM_VECTORS] = "MAX_VERTEX_UNIFORM_VECTORS"; + m_map[GL_MAX_VARYING_VECTORS] = "MAX_VARYING_VECTORS"; + m_map[GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS] = "MAX_COMBINED_TEXTURE_IMAGE_UNITS"; + m_map[GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS] = "MAX_VERTEX_TEXTURE_IMAGE_UNITS"; + m_map[GL_MAX_TEXTURE_IMAGE_UNITS] = "MAX_TEXTURE_IMAGE_UNITS"; + m_map[GL_MAX_FRAGMENT_UNIFORM_VECTORS] = "MAX_FRAGMENT_UNIFORM_VECTORS"; + m_map[GL_SHADER_TYPE] = "SHADER_TYPE"; + m_map[GL_DELETE_STATUS] = "DELETE_STATUS"; + m_map[GL_LINK_STATUS] = "LINK_STATUS"; + m_map[GL_VALIDATE_STATUS] = "VALIDATE_STATUS"; + m_map[GL_ATTACHED_SHADERS] = "ATTACHED_SHADERS"; + m_map[GL_ACTIVE_UNIFORMS] = "ACTIVE_UNIFORMS"; + m_map[GL_ACTIVE_ATTRIBUTES] = "ACTIVE_ATTRIBUTES"; + m_map[GL_SHADING_LANGUAGE_VERSION] = "SHADING_LANGUAGE_VERSION"; + m_map[GL_CURRENT_PROGRAM] = "CURRENT_PROGRAM"; + + m_map[GL_NEVER] = "NEVER"; + m_map[GL_LESS] = "LESS"; + m_map[GL_EQUAL] = "EQUAL"; + m_map[GL_LEQUAL] = "LEQUAL"; + m_map[GL_GREATER] = "GREATER"; + m_map[GL_NOTEQUAL] = "NOTEQUAL"; + m_map[GL_GEQUAL] = "GEQUAL"; + m_map[GL_ALWAYS] = "ALWAYS"; + + m_map[GL_KEEP] = "KEEP"; + m_map[GL_REPLACE] = "REPLACE"; + m_map[GL_INCR] = "INCR"; + m_map[GL_DECR] = "DECR"; + m_map[GL_INVERT] = "INVERT"; + m_map[GL_INCR_WRAP] = "INCR_WRAP"; + m_map[GL_DECR_WRAP] = "DECR_WRAP"; + + m_map[GL_VENDOR] = "VENDOR"; + m_map[GL_RENDERER] = "RENDERER"; + m_map[GL_VERSION] = "VERSION"; + + m_map[GL_NEAREST] = "NEAREST"; + m_map[GL_LINEAR] = "LINEAR"; + + m_map[GL_NEAREST_MIPMAP_NEAREST] = "NEAREST_MIPMAP_NEAREST"; + m_map[GL_LINEAR_MIPMAP_NEAREST] = "LINEAR_MIPMAP_NEAREST"; + m_map[GL_NEAREST_MIPMAP_LINEAR] = "NEAREST_MIPMAP_LINEAR"; + m_map[GL_LINEAR_MIPMAP_LINEAR] = "LINEAR_MIPMAP_LINEAR"; + + m_map[GL_TEXTURE_MAG_FILTER] = "TEXTURE_MAG_FILTER"; + m_map[GL_TEXTURE_MIN_FILTER] = "TEXTURE_MIN_FILTER"; + m_map[GL_TEXTURE_WRAP_S] = "TEXTURE_WRAP_S"; + m_map[GL_TEXTURE_WRAP_T] = "TEXTURE_WRAP_T"; + + m_map[GL_TEXTURE_2D] = "TEXTURE_2D"; + m_map[GL_TEXTURE] = "TEXTURE"; + + m_map[GL_TEXTURE_CUBE_MAP] = "TEXTURE_CUBE_MAP"; + m_map[GL_TEXTURE_BINDING_CUBE_MAP] = "TEXTURE_BINDING_CUBE_MAP"; + m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_X] = "TEXTURE_CUBE_MAP_POSITIVE_X"; + m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_X] = "TEXTURE_CUBE_MAP_NEGATIVE_X"; + m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Y] = "TEXTURE_CUBE_MAP_POSITIVE_Y"; + m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Y] = "TEXTURE_CUBE_MAP_NEGATIVE_Y"; + m_map[GL_TEXTURE_CUBE_MAP_POSITIVE_Z] = "TEXTURE_CUBE_MAP_POSITIVE_Z"; + m_map[GL_TEXTURE_CUBE_MAP_NEGATIVE_Z] = "TEXTURE_CUBE_MAP_NEGATIVE_Z"; + m_map[GL_MAX_CUBE_MAP_TEXTURE_SIZE] = "MAX_CUBE_MAP_TEXTURE_SIZE"; + + m_map[GL_TEXTURE0] = "TEXTURE0"; + m_map[GL_TEXTURE1] = "TEXTURE1"; + m_map[GL_TEXTURE2] = "TEXTURE2"; + m_map[GL_TEXTURE3] = "TEXTURE3"; + m_map[GL_TEXTURE4] = "TEXTURE4"; + m_map[GL_TEXTURE5] = "TEXTURE5"; + m_map[GL_TEXTURE6] = "TEXTURE6"; + m_map[GL_TEXTURE7] = "TEXTURE7"; + m_map[GL_TEXTURE8] = "TEXTURE8"; + m_map[GL_TEXTURE9] = "TEXTURE9"; + m_map[GL_TEXTURE10] = "TEXTURE10"; + m_map[GL_TEXTURE11] = "TEXTURE11"; + m_map[GL_TEXTURE12] = "TEXTURE12"; + m_map[GL_TEXTURE13] = "TEXTURE13"; + m_map[GL_TEXTURE14] = "TEXTURE14"; + m_map[GL_TEXTURE15] = "TEXTURE15"; + m_map[GL_TEXTURE16] = "TEXTURE16"; + m_map[GL_TEXTURE17] = "TEXTURE17"; + m_map[GL_TEXTURE18] = "TEXTURE18"; + m_map[GL_TEXTURE19] = "TEXTURE19"; + m_map[GL_TEXTURE20] = "TEXTURE20"; + m_map[GL_TEXTURE21] = "TEXTURE21"; + m_map[GL_TEXTURE22] = "TEXTURE22"; + m_map[GL_TEXTURE23] = "TEXTURE23"; + m_map[GL_TEXTURE24] = "TEXTURE24"; + m_map[GL_TEXTURE25] = "TEXTURE25"; + m_map[GL_TEXTURE26] = "TEXTURE26"; + m_map[GL_TEXTURE27] = "TEXTURE27"; + m_map[GL_TEXTURE28] = "TEXTURE28"; + m_map[GL_TEXTURE29] = "TEXTURE29"; + m_map[GL_TEXTURE30] = "TEXTURE30"; + m_map[GL_TEXTURE31] = "TEXTURE31"; + m_map[GL_ACTIVE_TEXTURE] = "ACTIVE_TEXTURE"; + + m_map[GL_REPEAT] = "REPEAT"; + m_map[GL_CLAMP_TO_EDGE] = "CLAMP_TO_EDGE"; + m_map[GL_MIRRORED_REPEAT] = "MIRRORED_REPEAT"; + + m_map[GL_FLOAT_VEC2] = "FLOAT_VEC2"; + m_map[GL_FLOAT_VEC3] = "FLOAT_VEC3"; + m_map[GL_FLOAT_VEC4] = "FLOAT_VEC4"; + m_map[GL_INT_VEC2] = "INT_VEC2"; + m_map[GL_INT_VEC3] = "INT_VEC3"; + m_map[GL_INT_VEC4] = "INT_VEC4"; + m_map[GL_BOOL] = "BOOL"; + m_map[GL_BOOL_VEC2] = "BOOL_VEC2"; + m_map[GL_BOOL_VEC3] = "BOOL_VEC3"; + m_map[GL_BOOL_VEC4] = "BOOL_VEC4"; + m_map[GL_FLOAT_MAT2] = "FLOAT_MAT2"; + m_map[GL_FLOAT_MAT3] = "FLOAT_MAT3"; + m_map[GL_FLOAT_MAT4] = "FLOAT_MAT4"; + m_map[GL_SAMPLER_2D] = "SAMPLER_2D"; + m_map[GL_SAMPLER_CUBE] = "SAMPLER_CUBE"; + + m_map[GL_VERTEX_ATTRIB_ARRAY_ENABLED] = "VERTEX_ATTRIB_ARRAY_ENABLED"; + m_map[GL_VERTEX_ATTRIB_ARRAY_SIZE] = "VERTEX_ATTRIB_ARRAY_SIZE"; + m_map[GL_VERTEX_ATTRIB_ARRAY_STRIDE] = "VERTEX_ATTRIB_ARRAY_STRIDE"; + m_map[GL_VERTEX_ATTRIB_ARRAY_TYPE] = "VERTEX_ATTRIB_ARRAY_TYPE"; + m_map[GL_VERTEX_ATTRIB_ARRAY_NORMALIZED] = "VERTEX_ATTRIB_ARRAY_NORMALIZED"; + m_map[GL_VERTEX_ATTRIB_ARRAY_POINTER] = "VERTEX_ATTRIB_ARRAY_POINTER"; + m_map[GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING] = "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING"; + + m_map[GL_COMPILE_STATUS] = "COMPILE_STATUS"; + + m_map[GL_LOW_FLOAT] = "LOW_FLOAT"; + m_map[GL_MEDIUM_FLOAT] = "MEDIUM_FLOAT"; + m_map[GL_HIGH_FLOAT] = "HIGH_FLOAT"; + m_map[GL_LOW_INT] = "LOW_INT"; + m_map[GL_MEDIUM_INT] = "MEDIUM_INT"; + m_map[GL_HIGH_INT] = "HIGH_INT"; + + m_map[GL_FRAMEBUFFER] = "FRAMEBUFFER"; + m_map[GL_RENDERBUFFER] = "RENDERBUFFER"; + + m_map[GL_RGBA4] = "RGBA4"; + m_map[GL_RGB5_A1] = "RGB5_A1"; + m_map[GL_RGB565] = "RGB565"; + m_map[GL_DEPTH_COMPONENT16] = "DEPTH_COMPONENT16"; + m_map[GL_STENCIL_INDEX] = "STENCIL_INDEX"; + m_map[GL_STENCIL_INDEX8] = "STENCIL_INDEX8"; + + m_map[GL_RENDERBUFFER_WIDTH] = "RENDERBUFFER_WIDTH"; + m_map[GL_RENDERBUFFER_HEIGHT] = "RENDERBUFFER_HEIGHT"; + m_map[GL_RENDERBUFFER_INTERNAL_FORMAT] = "RENDERBUFFER_INTERNAL_FORMAT"; + m_map[GL_RENDERBUFFER_RED_SIZE] = "RENDERBUFFER_RED_SIZE"; + m_map[GL_RENDERBUFFER_GREEN_SIZE] = "RENDERBUFFER_GREEN_SIZE"; + m_map[GL_RENDERBUFFER_BLUE_SIZE] = "RENDERBUFFER_BLUE_SIZE"; + m_map[GL_RENDERBUFFER_ALPHA_SIZE] = "RENDERBUFFER_ALPHA_SIZE"; + m_map[GL_RENDERBUFFER_DEPTH_SIZE] = "RENDERBUFFER_DEPTH_SIZE"; + m_map[GL_RENDERBUFFER_STENCIL_SIZE] = "RENDERBUFFER_STENCIL_SIZE"; + + m_map[GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE] = "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE"; + m_map[GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME] = "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME"; + m_map[GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL"; + m_map[GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE"; + + m_map[GL_COLOR_ATTACHMENT0] = "COLOR_ATTACHMENT0"; + m_map[GL_DEPTH_ATTACHMENT] = "DEPTH_ATTACHMENT"; + m_map[GL_STENCIL_ATTACHMENT] = "STENCIL_ATTACHMENT"; + + m_map[GL_FRAMEBUFFER_COMPLETE] = "FRAMEBUFFER_COMPLETE"; + m_map[GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT] = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT"; + m_map[GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT] = "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"; + m_map[GL_FRAMEBUFFER_UNSUPPORTED] = "FRAMEBUFFER_UNSUPPORTED"; + + m_map[GL_FRAMEBUFFER_BINDING] = "FRAMEBUFFER_BINDING"; + m_map[GL_RENDERBUFFER_BINDING] = "RENDERBUFFER_BINDING"; + m_map[GL_MAX_RENDERBUFFER_SIZE] = "MAX_RENDERBUFFER_SIZE"; + + m_map[GL_INVALID_FRAMEBUFFER_OPERATION] = "INVALID_FRAMEBUFFER_OPERATION"; +} + +QString EnumToStringMap::lookUp(const GLuint value) const +{ + if (m_map.contains(value)) + return m_map[value]; + + return QString("0x0%1").arg(value, 0, 16); +} + diff --git a/src/datavisualizationqml2/enumtostringmap_p.h b/src/datavisualizationqml2/enumtostringmap_p.h new file mode 100644 index 00000000..2206f153 --- /dev/null +++ b/src/datavisualizationqml2/enumtostringmap_p.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef ENUMTOSTRINGMAP_P_H +#define ENUMTOSTRINGMAP_P_H + +#include +#include +#include + +class EnumToStringMap +{ +public: + static EnumToStringMap *newInstance(); + static void deleteInstance(); + QString lookUp(const GLuint value) const; + +private: + EnumToStringMap(); + QMap m_map; + QString m_unknown; +}; + +#endif diff --git a/src/datavisualizationqml2/glstatestore.cpp b/src/datavisualizationqml2/glstatestore.cpp new file mode 100644 index 00000000..f053078b --- /dev/null +++ b/src/datavisualizationqml2/glstatestore.cpp @@ -0,0 +1,377 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ +#include "glstatestore_p.h" +#include +#include +#include + +#ifdef VERBOSE_STATE_STORE +static QFile *beforeFile = 0; +static QFile *afterFile = 0; +#endif + +GLStateStore::GLStateStore(QOpenGLContext *context, QObject *parent) : + QObject(parent), + QOpenGLFunctions(context) + #ifdef VERBOSE_STATE_STORE + , m_map(EnumToStringMap::newInstance()) + #endif +{ + GLint maxVertexAttribs; + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); + +#ifdef VERBOSE_STATE_STORE + qDebug() << "GL_MAX_VERTEX_ATTRIBS: " << maxVertexAttribs; + if (!beforeFile) { + beforeFile = new QFile(QStringLiteral("state_before.txt")); + afterFile = new QFile(QStringLiteral("state_after.txt")); + beforeFile->open(QIODevice::WriteOnly); + afterFile->open(QIODevice::WriteOnly); + QDebug beforeInit(beforeFile); + QDebug afterInit(afterFile); + beforeInit << "GL states before 'context switch'" << endl; + afterInit << "GL states after 'context switch'" << endl; + } +#endif + + m_maxVertexAttribs = qMin(maxVertexAttribs, 2); // Datavis only uses 2 attribs max + m_vertexAttribArrayEnabledStates = new GLint[maxVertexAttribs]; + m_vertexAttribArrayBoundBuffers = new GLint[maxVertexAttribs]; + m_vertexAttribArraySizes = new GLint[maxVertexAttribs]; + m_vertexAttribArrayTypes = new GLint[maxVertexAttribs]; + m_vertexAttribArrayNormalized = new GLint[maxVertexAttribs]; + m_vertexAttribArrayStrides = new GLint[maxVertexAttribs]; + m_vertexAttribArrayOffsets = new GLint[maxVertexAttribs]; + + initGLDefaultState(); +} + +GLStateStore::~GLStateStore() +{ +#ifdef VERBOSE_STATE_STORE + EnumToStringMap::deleteInstance(); + m_map = 0; +#endif + delete m_vertexAttribArrayEnabledStates; + delete m_vertexAttribArrayBoundBuffers; +} + +void GLStateStore::storeGLState() +{ +#ifdef VERBOSE_STATE_STORE + printCurrentState(true); +#endif + +#if !defined(QT_OPENGL_ES_2) + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &m_drawFramebuffer); + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &m_readFramebuffer); +#endif + glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_renderbuffer); + glGetFloatv(GL_COLOR_CLEAR_VALUE, m_clearColor); + m_isBlendingEnabled = glIsEnabled(GL_BLEND); + m_isDepthTestEnabled = glIsEnabled(GL_DEPTH_TEST); + glGetBooleanv(GL_DEPTH_WRITEMASK, &m_isDepthWriteEnabled); + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &m_clearDepth); + glGetIntegerv(GL_DEPTH_FUNC, &m_depthFunc); + glGetBooleanv(GL_POLYGON_OFFSET_FILL, &m_polygonOffsetFillEnabled); + glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &m_polygonOffsetFactor); + glGetFloatv(GL_POLYGON_OFFSET_UNITS, &m_polygonOffsetUnits); + + glGetIntegerv(GL_CURRENT_PROGRAM, &m_currentProgram); + glGetIntegerv(GL_ACTIVE_TEXTURE, &m_activeTexture); + glGetIntegerv(GL_TEXTURE_BINDING_2D, &m_texBinding2D); + glGetIntegerv(GL_FRONT_FACE, &m_frontFace); + m_isCullFaceEnabled = glIsEnabled(GL_CULL_FACE); + glGetIntegerv(GL_CULL_FACE_MODE, &m_cullFaceMode); + glGetIntegerv(GL_BLEND_EQUATION_RGB, &m_blendEquationRGB); + glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &m_blendEquationAlpha); + glGetIntegerv(GL_BLEND_DST_ALPHA, &m_blendDestAlpha); + glGetIntegerv(GL_BLEND_DST_RGB, &m_blendDestRGB); + glGetIntegerv(GL_BLEND_SRC_ALPHA, &m_blendSrcAlpha); + glGetIntegerv(GL_BLEND_SRC_RGB, &m_blendSrcRGB); + glGetIntegerv(GL_SCISSOR_BOX, m_scissorBox); + m_isScissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &m_boundArrayBuffer); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &m_boundElementArrayBuffer); + + for (int i = 0; i < m_maxVertexAttribs;i++) { + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &m_vertexAttribArrayEnabledStates[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &m_vertexAttribArrayBoundBuffers[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &m_vertexAttribArraySizes[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, &m_vertexAttribArrayTypes[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &m_vertexAttribArrayNormalized[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &m_vertexAttribArrayStrides[i]); + } +} + +#ifdef VERBOSE_STATE_STORE +void GLStateStore::printCurrentState(bool in) +{ + QFile *file; + if (in) + file = beforeFile; + else + file = afterFile; + + if (file->isOpen()) { + QDebug msg(file); +#if !defined(QT_OPENGL_ES_2) + GLint drawFramebuffer; + GLint readFramebuffer; +#endif + GLint renderbuffer; + GLfloat clearColor[4]; + GLfloat clearDepth; + GLboolean isBlendingEnabled = glIsEnabled(GL_BLEND); + GLboolean isDepthTestEnabled = glIsEnabled(GL_DEPTH_TEST); + GLint depthFunc; + GLboolean isDepthWriteEnabled; + GLint currentProgram; + GLint *vertexAttribArrayEnabledStates = new GLint[m_maxVertexAttribs]; + GLint *vertexAttribArrayBoundBuffers = new GLint[m_maxVertexAttribs]; + GLint *vertexAttribArraySizes = new GLint[m_maxVertexAttribs]; + GLint *vertexAttribArrayTypes = new GLint[m_maxVertexAttribs]; + GLint *vertexAttribArrayNormalized = new GLint[m_maxVertexAttribs]; + GLint *vertexAttribArrayStrides = new GLint[m_maxVertexAttribs]; + GLint activeTexture; + GLint texBinding2D; + GLint arrayBufferBinding; + GLint frontFace; + GLboolean isCullFaceEnabled = glIsEnabled(GL_CULL_FACE); + GLint cullFaceMode; + GLint blendEquationRGB; + GLint blendEquationAlpha; + + GLint blendDestAlpha; + GLint blendDestRGB; + GLint blendSrcAlpha; + GLint blendSrcRGB; + GLint scissorBox[4]; + GLboolean isScissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + GLint boundElementArrayBuffer; + GLboolean polygonOffsetFillEnabled; + GLfloat polygonOffsetFactor; + GLfloat polygonOffsetUnits; + + glGetBooleanv(GL_DEPTH_WRITEMASK, &isDepthWriteEnabled); +#if !defined(QT_OPENGL_ES_2) + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFramebuffer); + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFramebuffer); +#endif + glGetIntegerv(GL_RENDERBUFFER_BINDING, &renderbuffer); + glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor); + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth); + glGetIntegerv(GL_DEPTH_FUNC, &depthFunc); + glGetBooleanv(GL_POLYGON_OFFSET_FILL, &polygonOffsetFillEnabled); + glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &polygonOffsetFactor); + glGetFloatv(GL_POLYGON_OFFSET_UNITS, &polygonOffsetUnits); + + glGetIntegerv(GL_CURRENT_PROGRAM, ¤tProgram); + glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture); + glGetIntegerv(GL_TEXTURE_BINDING_2D, &texBinding2D ); + glGetIntegerv(GL_FRONT_FACE, &frontFace); + glGetIntegerv(GL_CULL_FACE_MODE, &cullFaceMode); + glGetIntegerv(GL_BLEND_EQUATION_RGB, &blendEquationRGB); + glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &blendEquationAlpha); + glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDestAlpha); + glGetIntegerv(GL_BLEND_DST_RGB, &blendDestRGB); + glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrcAlpha); + glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcRGB); + glGetIntegerv(GL_SCISSOR_BOX, scissorBox); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &boundElementArrayBuffer); + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &arrayBufferBinding); + + for (int i = 0; i < m_maxVertexAttribs;i++) { + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &vertexAttribArrayEnabledStates[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &vertexAttribArrayBoundBuffers[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &vertexAttribArraySizes[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, &vertexAttribArrayTypes[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &vertexAttribArrayNormalized[i]); + glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &vertexAttribArrayStrides[i]); + } + + QColor color; + color.setRgbF(clearColor[0], clearColor[1], clearColor[2]); + color.setAlphaF(clearColor[3]); + +#if !defined(QT_OPENGL_ES_2) + msg << "---" << endl; + msg << " GL_DRAW_FRAMEBUFFER_BINDING "<< drawFramebuffer << endl; + msg << " GL_READ_FRAMEBUFFER_BINDING "<< readFramebuffer << endl; +#endif + msg << " GL_RENDERBUFFER_BINDING " << renderbuffer << endl; + msg << " GL_SCISSOR_TEST " << bool(isScissorTestEnabled) << endl; + msg << " GL_SCISSOR_BOX " << m_scissorBox[0] << m_scissorBox[1] << m_scissorBox[2] + << m_scissorBox[3] << endl; + msg << " GL_COLOR_CLEAR_VALUE "<< color << endl; + msg << " GL_DEPTH_CLEAR_VALUE "<< clearDepth << endl; + msg << " GL_BLEND "<< bool(isBlendingEnabled) << endl; + msg << " GL_BLEND_EQUATION_RGB" << m_map->lookUp(blendEquationRGB) << endl; + msg << " GL_BLEND_EQUATION_ALPHA" << m_map->lookUp(blendEquationAlpha) << endl; + msg << " GL_BLEND_DST_ALPHA" << m_map->lookUp(blendDestAlpha) << endl; + msg << " GL_BLEND_DST_RGB" << m_map->lookUp(blendDestRGB) << endl; + msg << " GL_BLEND_SRC_ALPHA" << m_map->lookUp(blendSrcAlpha) << endl; + msg << " GL_BLEND_SRC_RGB" << m_map->lookUp(blendSrcRGB) << endl; + msg << " GL_DEPTH_TEST "<< bool(isDepthTestEnabled) << endl; + msg << " GL_DEPTH_WRITEMASK "<< bool(isDepthWriteEnabled) << endl; + msg << " GL_POLYGON_OFFSET_FILL" << bool(polygonOffsetFillEnabled) << endl; + msg << " GL_POLYGON_OFFSET_FACTOR "<< polygonOffsetFactor << endl; + msg << " GL_POLYGON_OFFSET_UNITS "<< polygonOffsetUnits << endl; + msg << " GL_CULL_FACE "<< bool(isCullFaceEnabled) << endl; + msg << " GL_CULL_FACE_MODE "<< m_map->lookUp(cullFaceMode) << endl; + msg << " GL_DEPTH_FUNC "<< m_map->lookUp(depthFunc) << endl; + msg << " GL_FRONT_FACE "<< m_map->lookUp(frontFace) << endl; + msg << " GL_CURRENT_PROGRAM "<< currentProgram << endl; + msg << " GL_ACTIVE_TEXTURE "<< QString("0x%1").arg(activeTexture, 0, 16) << endl; + msg << " GL_TEXTURE_BINDING_2D "<< texBinding2D << endl; + msg << " GL_ELEMENT_ARRAY_BUFFER_BINDING "<< boundElementArrayBuffer << endl; + msg << " GL_ARRAY_BUFFER_BINDING "<< arrayBufferBinding << endl; + for (int i = 0; i < m_maxVertexAttribs;i++) { + msg << " GL_VERTEX_ATTRIB_ARRAY_ENABLED "<< i << " = " + << bool(vertexAttribArrayEnabledStates[i]) << endl; + msg << " GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING"<< i << " = " + << vertexAttribArrayBoundBuffers[i] << endl; + msg << " GL_VERTEX_ATTRIB_ARRAY_SIZE"<< i << " = " + << vertexAttribArraySizes[i] << endl; + msg << " GL_VERTEX_ATTRIB_ARRAY_TYPE"<< i << " = " + << vertexAttribArrayTypes[i] << endl; + msg << " GL_VERTEX_ATTRIB_ARRAY_NORMALIZED"<< i << " = " + << vertexAttribArrayNormalized[i] << endl; + msg << " GL_VERTEX_ATTRIB_ARRAY_STRIDE"<< i << " = " + << vertexAttribArrayStrides[i] << endl; + } + } +} +#endif + +void GLStateStore::restoreGLState() +{ +#if !defined(QT_OPENGL_ES_2) + glBindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebuffer); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_drawFramebuffer); +#endif + glBindRenderbuffer(GL_RENDERBUFFER_BINDING, m_renderbuffer); + + if (m_isScissorTestEnabled) + glEnable(GL_SCISSOR_TEST); + else + glDisable(GL_SCISSOR_TEST); + + glScissor(m_scissorBox[0], m_scissorBox[1], m_scissorBox[2], m_scissorBox[3]); + glClearColor(m_clearColor[0], m_clearColor[1], m_clearColor[2], m_clearColor[3]); + glClearDepthf(m_clearDepth); + if (m_isBlendingEnabled) + glEnable(GL_BLEND); + else + glDisable(GL_BLEND); + + if (m_isDepthTestEnabled) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); + + if (m_isCullFaceEnabled) + glEnable(GL_CULL_FACE); + else + glDisable(GL_CULL_FACE); + + glCullFace(m_cullFaceMode); + + glBlendEquationSeparate(m_blendEquationRGB, m_blendEquationAlpha); + glBlendFuncSeparate(m_blendSrcRGB, m_blendDestRGB, m_blendSrcAlpha, m_blendDestAlpha); + + glDepthMask(m_isDepthWriteEnabled); + glDepthFunc(m_depthFunc); + glFrontFace(m_frontFace); + + if (m_polygonOffsetFillEnabled) + glEnable(GL_POLYGON_OFFSET_FILL); + else + glDisable(GL_POLYGON_OFFSET_FILL); + + glPolygonOffset(m_polygonOffsetFactor, m_polygonOffsetUnits); + + glUseProgram(m_currentProgram); + + glActiveTexture(m_activeTexture); + glBindTexture(GL_TEXTURE_2D, m_texBinding2D); + + // Restore bound element array buffer and array buffers + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_boundElementArrayBuffer); + for (int i = 0; i < m_maxVertexAttribs; i++) { + if (m_vertexAttribArrayEnabledStates[i]) + glEnableVertexAttribArray(i); + else + glDisableVertexAttribArray(i); + + glBindBuffer(GL_ARRAY_BUFFER, m_vertexAttribArrayBoundBuffers[i]); + glVertexAttribPointer(i, m_vertexAttribArraySizes[i], + m_vertexAttribArrayTypes[i], + m_vertexAttribArrayNormalized[i], + m_vertexAttribArrayStrides[i], + (void *) m_vertexAttribArrayOffsets[i]); + } + + glBindBuffer(GL_ARRAY_BUFFER, m_boundArrayBuffer); + +#ifdef VERBOSE_STATE_STORE + printCurrentState(false); +#endif +} + +void GLStateStore::initGLDefaultState() +{ +#if !defined(QT_OPENGL_ES_2) + m_drawFramebuffer = 0; + m_readFramebuffer = 0; +#endif + m_renderbuffer = 0; + m_clearColor[0] = m_clearColor[1] = m_clearColor[2] = m_clearColor[3] = 1.0f; + m_clearDepth = 1.0f; + m_isBlendingEnabled = GL_FALSE; + m_isDepthTestEnabled = GL_FALSE; + m_depthFunc = GL_LESS; + m_isDepthWriteEnabled = GL_TRUE; + m_currentProgram = 0; + m_texBinding2D = 0; + for (int i = 0; i < m_maxVertexAttribs;i++) { + m_vertexAttribArrayEnabledStates[i] = GL_FALSE; + m_vertexAttribArrayBoundBuffers[i] = 0; + m_vertexAttribArraySizes[i] = 4; + m_vertexAttribArrayTypes[i] = GL_FLOAT; + m_vertexAttribArrayNormalized[i] = GL_FALSE; + m_vertexAttribArrayStrides[i] = 0; + m_vertexAttribArrayOffsets[i] = 0; + } + m_activeTexture = GL_TEXTURE0; + m_frontFace = GL_CCW; + m_isCullFaceEnabled = false; + m_cullFaceMode = GL_BACK; + m_blendEquationRGB = GL_FUNC_ADD; + m_blendEquationAlpha = GL_FUNC_ADD; + m_scissorBox[0] = 0; + m_scissorBox[1] = 0; + m_scissorBox[2] = 0; + m_scissorBox[3] = 0; + m_isScissorTestEnabled = GL_FALSE; + + m_polygonOffsetFillEnabled = GL_FALSE; + m_polygonOffsetFactor = 0.0; + m_polygonOffsetUnits = 0.0; +} diff --git a/src/datavisualizationqml2/glstatestore_p.h b/src/datavisualizationqml2/glstatestore_p.h new file mode 100644 index 00000000..560598bf --- /dev/null +++ b/src/datavisualizationqml2/glstatestore_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef GLSTATESTORE_P_H +#define GLSTATESTORE_P_H + +//#define VERBOSE_STATE_STORE + +#include +#include +#include +#ifdef VERBOSE_STATE_STORE +#include "enumtostringmap_p.h" +#endif + +class GLStateStore : public QObject, protected QOpenGLFunctions +{ + Q_OBJECT +public: + explicit GLStateStore(QOpenGLContext *context, QObject *parent = 0); + ~GLStateStore(); + + void storeGLState(); + void restoreGLState(); + void initGLDefaultState(); + +#ifdef VERBOSE_STATE_STORE + void printCurrentState(bool in); + EnumToStringMap *m_map; +#endif + + GLint m_scissorBox[4]; + GLboolean m_isScissorTestEnabled; + +#if !defined(QT_OPENGL_ES_2) + GLint m_drawFramebuffer; + GLint m_readFramebuffer; +#endif + GLint m_renderbuffer; + GLfloat m_clearColor[4]; + GLfloat m_clearDepth; + GLboolean m_isBlendingEnabled; + GLboolean m_isDepthTestEnabled; + GLint m_depthFunc; + GLboolean m_isDepthWriteEnabled; + GLint m_currentProgram; + GLint m_maxVertexAttribs; + GLint *m_vertexAttribArrayEnabledStates; + GLint *m_vertexAttribArrayBoundBuffers; + GLint *m_vertexAttribArraySizes; + GLint *m_vertexAttribArrayTypes; + GLint *m_vertexAttribArrayNormalized; + GLint *m_vertexAttribArrayStrides; + GLint *m_vertexAttribArrayOffsets; + + GLint m_activeTexture; + GLint m_texBinding2D; + GLint m_frontFace; + GLboolean m_isCullFaceEnabled; + GLint m_cullFaceMode; + GLint m_blendEquationRGB; + GLint m_blendEquationAlpha; + GLint m_blendDestAlpha; + GLint m_blendDestRGB; + GLint m_blendSrcAlpha; + GLint m_blendSrcRGB; + GLint m_boundArrayBuffer; + GLint m_boundElementArrayBuffer; + GLboolean m_polygonOffsetFillEnabled; + GLfloat m_polygonOffsetFactor; + GLfloat m_polygonOffsetUnits; +}; + +#endif -- cgit v1.2.3 From fbccda387ee501ff49f5f1e3e7d029b74986f39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 28 Feb 2014 12:46:55 +0200 Subject: Compilation warning fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id69075897ae4e4fe5ce0c6e8f1f4f904b4ab44f1 Change-Id: Id69075897ae4e4fe5ce0c6e8f1f4f904b4ab44f1 Reviewed-by: Tomi Korpipää --- src/datavisualization/input/qtouch3dinputhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datavisualization/input/qtouch3dinputhandler.cpp b/src/datavisualization/input/qtouch3dinputhandler.cpp index fc398e81..d40fbf5a 100644 --- a/src/datavisualization/input/qtouch3dinputhandler.cpp +++ b/src/datavisualization/input/qtouch3dinputhandler.cpp @@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION const float maxTapAndHoldJitter = 20.0f; const int maxPinchJitter = 10; -#if defined (Q_OS_ANDROID) or defined(Q_OS_IOS) +#if defined (Q_OS_ANDROID) || defined(Q_OS_IOS) const int maxSelectionJitter = 10; #else const int maxSelectionJitter = 5; -- cgit v1.2.3 From 5d224030a5295cd2f60a57887689c428dcfc2267 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 28 Feb 2014 13:08:51 +0200 Subject: New multi-window test app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iff97d020ef6104d266dbc53931e44d494b415800 Reviewed-by: Tomi Korpipää --- tests/qmlmultiwindow/main.cpp | 47 ++++ tests/qmlmultiwindow/qml/qmlmultiwindow/Data.qml | 48 ++++ .../qml/qmlmultiwindow/NewButton.qml | 52 +++++ tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml | 258 +++++++++++++++++++++ tests/qmlmultiwindow/qmlmultiwindow.pro | 12 + tests/qmlmultiwindow/qmlmultiwindow.qrc | 7 + tests/tests.pro | 3 +- 7 files changed, 426 insertions(+), 1 deletion(-) create mode 100644 tests/qmlmultiwindow/main.cpp create mode 100644 tests/qmlmultiwindow/qml/qmlmultiwindow/Data.qml create mode 100644 tests/qmlmultiwindow/qml/qmlmultiwindow/NewButton.qml create mode 100644 tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml create mode 100644 tests/qmlmultiwindow/qmlmultiwindow.pro create mode 100644 tests/qmlmultiwindow/qmlmultiwindow.qrc diff --git a/tests/qmlmultiwindow/main.cpp b/tests/qmlmultiwindow/main.cpp new file mode 100644 index 00000000..33122641 --- /dev/null +++ b/tests/qmlmultiwindow/main.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQuickView viewer; + + // The following are needed to make examples run without having to install the module + // in desktop environments. +#ifdef Q_OS_WIN + QString extraImportPath(QStringLiteral("%1/../../../%2")); +#else + QString extraImportPath(QStringLiteral("%1/../../%2")); +#endif + viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(), + QString::fromLatin1("qml"))); + QObject::connect(viewer.engine(), &QQmlEngine::quit, &viewer, &QWindow::close); + + viewer.setTitle(QStringLiteral("QML multiwindow example")); + viewer.setSource(QUrl("qrc:/qml/qmlmultiwindow/main.qml")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.show(); + + return app.exec(); +} diff --git a/tests/qmlmultiwindow/qml/qmlmultiwindow/Data.qml b/tests/qmlmultiwindow/qml/qmlmultiwindow/Data.qml new file mode 100644 index 00000000..43152e50 --- /dev/null +++ b/tests/qmlmultiwindow/qml/qmlmultiwindow/Data.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.1 + +Item { + property alias data: dataModel + + ListModel { + id: dataModel + ListElement{ row: "0"; col: "0"; longitude: "20.0"; latitude: "10.0"; pop_density: "4.75"; } + ListElement{ row: "1"; col: "0"; longitude: "21.1"; latitude: "10.3"; pop_density: "3.00"; } + ListElement{ row: "2"; col: "0"; longitude: "22.5"; latitude: "10.7"; pop_density: "1.24"; } + ListElement{ row: "3"; col: "0"; longitude: "24.0"; latitude: "10.5"; pop_density: "2.53"; } + ListElement{ row: "0"; col: "1"; longitude: "20.2"; latitude: "11.2"; pop_density: "3.55"; } + ListElement{ row: "1"; col: "1"; longitude: "21.3"; latitude: "11.5"; pop_density: "3.03"; } + ListElement{ row: "2"; col: "1"; longitude: "22.6"; latitude: "11.7"; pop_density: "3.46"; } + ListElement{ row: "3"; col: "1"; longitude: "23.4"; latitude: "11.5"; pop_density: "4.12"; } + ListElement{ row: "0"; col: "2"; longitude: "20.2"; latitude: "12.3"; pop_density: "3.37"; } + ListElement{ row: "1"; col: "2"; longitude: "21.1"; latitude: "12.4"; pop_density: "2.98"; } + ListElement{ row: "2"; col: "2"; longitude: "22.5"; latitude: "12.1"; pop_density: "3.33"; } + ListElement{ row: "3"; col: "2"; longitude: "23.3"; latitude: "12.7"; pop_density: "3.23"; } + ListElement{ row: "0"; col: "3"; longitude: "20.7"; latitude: "13.3"; pop_density: "5.34"; } + ListElement{ row: "1"; col: "3"; longitude: "21.5"; latitude: "13.2"; pop_density: "4.54"; } + ListElement{ row: "2"; col: "3"; longitude: "22.4"; latitude: "13.6"; pop_density: "4.65"; } + ListElement{ row: "3"; col: "3"; longitude: "23.2"; latitude: "13.4"; pop_density: "6.67"; } + ListElement{ row: "0"; col: "4"; longitude: "20.6"; latitude: "15.0"; pop_density: "6.01"; } + ListElement{ row: "1"; col: "4"; longitude: "21.3"; latitude: "14.6"; pop_density: "5.83"; } + ListElement{ row: "2"; col: "4"; longitude: "22.5"; latitude: "14.8"; pop_density: "7.32"; } + ListElement{ row: "3"; col: "4"; longitude: "23.7"; latitude: "14.3"; pop_density: "6.90"; } + } +} + diff --git a/tests/qmlmultiwindow/qml/qmlmultiwindow/NewButton.qml b/tests/qmlmultiwindow/qml/qmlmultiwindow/NewButton.qml new file mode 100644 index 00000000..e4fb99d2 --- /dev/null +++ b/tests/qmlmultiwindow/qml/qmlmultiwindow/NewButton.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.0 + +Item { + id: newbutton + + property alias text: buttonText.text + + signal clicked + + implicitWidth: buttonText.implicitWidth + 5 + implicitHeight: buttonText.implicitHeight + 10 + + Button { + id: buttonText + width: parent.width + height: parent.height + + style: ButtonStyle { + label: Component { + Text { + text: buttonText.text + clip: true + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.fill: parent + } + } + } + onClicked: newbutton.clicked() + } +} diff --git a/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml b/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml new file mode 100644 index 00000000..fc7626b3 --- /dev/null +++ b/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml @@ -0,0 +1,258 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Window 2.1 +import QtQuick.Layouts 1.0 +import QtDataVisualization 1.0 +import "." + +Rectangle { + id: mainView + width: 800 + height: 600 + + Data { + id: data + } + + Window { + id: firstWindow + x: 100 + y: 100 + width: 500 + height: 500 + visible: true + Rectangle { + id: firstRect + color: "red" + anchors.fill: parent + } + } + + Window { + id: secondWindow + x: 100 + y: 700 + width: 500 + height: 500 + visible: true + Rectangle { + id: secondRect + color: "blue" + anchors.fill: parent + } + } + + states: [ + State { + name: "firstWindow" + ParentChange { target: surfaceGraph; parent: firstRect; x: 0; y: 0 } + }, + State { + name: "secondWindow" + ParentChange { target: surfaceGraph; parent: secondRect; x: 0; y: 0 } + } + ] + + state: "firstWindow" + + //! [0] + GridLayout { + id: gridLayout + columns: 2 + Layout.fillHeight: true + Layout.fillWidth: true + anchors.top: mainView.top + anchors.bottom: mainView.bottom + anchors.left: mainView.left + anchors.right: mainView.right + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: surfaceGraph.theme.gridLineColor + border.width: 2 + + Surface3D { + id: surfaceGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { + type: Theme3D.ThemePrimaryColors + font.pointSize: 60 + } + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Surface3DSeries { + itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel" + ItemModelSurfaceDataProxy { + itemModel: data.data + // The surface data points are not neatly lined up in rows and columns, + // so we define explicit row and column roles. + rowRole: "row" + columnRole: "col" + xPosRole: "latitude" + zPosRole: "longitude" + yPosRole: "pop_density" + } + } + } + } + + // We'll use one grid cell for buttons + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + + GridLayout { + anchors.right: parent.right + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + columns: 2 + + NewButton { + Layout.minimumWidth: parent.width / 2 + Layout.fillHeight: true + Layout.fillWidth: true + text: "Move graph between windows" + onClicked: { + if (mainView.state === "firstWindow") { + mainView.state = "secondWindow" + } else { + mainView.state = "firstWindow" + } + } + } + + NewButton { + Layout.minimumWidth: parent.width / 2 + Layout.fillHeight: true + Layout.fillWidth: true + text: "Quit" + onClicked: Qt.quit(0); + } + + NewButton { + Layout.fillHeight: true + Layout.fillWidth: true + text: "Reset Cameras" + onClicked: resetCameras() // call a helper function to keep button itself simpler + } + + NewButton { + Layout.fillHeight: true + Layout.fillWidth: true + text: "Toggle Mesh Styles" + onClicked: toggleMeshStyle() // call a helper function to keep button itself simpler + } + } + } + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: scatterGraph.theme.gridLineColor + border.width: 2 + + Scatter3D { + id: scatterGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { + type: Theme3D.ThemeDigia + font.pointSize: 60 + } + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Scatter3DSeries { + itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel" + ItemModelScatterDataProxy { + itemModel: data.data + // Mapping model roles to scatter series item coordinates. + xPosRole: "latitude" + zPosRole: "longitude" + yPosRole: "pop_density" + } + } + } + } + + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true + border.color: barGraph.theme.gridLineColor + border.width: 2 + + Bars3D { + id: barGraph + anchors.fill: parent + anchors.margins: parent.border.width + theme: Theme3D { + type: Theme3D.ThemeQt + font.pointSize: 60 + } + selectionMode: AbstractGraph3D.SelectionItemAndRow | AbstractGraph3D.SelectionSlice + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + + Bar3DSeries { + itemLabelFormat: "@seriesName: @valueLabel" + name: "Population density" + + ItemModelBarDataProxy { + itemModel: data.data + // Mapping model roles to bar series rows, columns, and values. + rowRole: "row" + columnRole: "col" + valueRole: "pop_density" + } + } + } + } + } + //! [0] + + function clearSelections() { + barGraph.clearSelection() + scatterGraph.clearSelection() + surfaceGraph.clearSelection() + } + + function resetCameras() { + surfaceGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh + scatterGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh + barGraph.scene.activeCamera.cameraPreset = Camera3D.CameraPresetIsometricLeftHigh + surfaceGraph.scene.activeCamera.zoomLevel = 100.0 + scatterGraph.scene.activeCamera.zoomLevel = 100.0 + barGraph.scene.activeCamera.zoomLevel = 100.0 + } + + function toggleMeshStyle() { + if (barGraph.seriesList[0].meshSmooth === true) { + barGraph.seriesList[0].meshSmooth = false + if (surfaceGraph.seriesList[0].flatShadingSupported) + surfaceGraph.seriesList[0].flatShadingEnabled = true + scatterGraph.seriesList[0].meshSmooth = false + } else { + barGraph.seriesList[0].meshSmooth = true + surfaceGraph.seriesList[0].flatShadingEnabled = false + scatterGraph.seriesList[0].meshSmooth = true + } + } +} diff --git a/tests/qmlmultiwindow/qmlmultiwindow.pro b/tests/qmlmultiwindow/qmlmultiwindow.pro new file mode 100644 index 00000000..c3e7d1bd --- /dev/null +++ b/tests/qmlmultiwindow/qmlmultiwindow.pro @@ -0,0 +1,12 @@ +!include( ../tests.pri ) { + error( "Couldn't find the tests.pri file!" ) +} + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +RESOURCES += qmlmultiwindow.qrc + +OTHER_FILES += doc/src/* \ + doc/images/* \ + qml/qmlmultiwindow/* diff --git a/tests/qmlmultiwindow/qmlmultiwindow.qrc b/tests/qmlmultiwindow/qmlmultiwindow.qrc new file mode 100644 index 00000000..31a92b25 --- /dev/null +++ b/tests/qmlmultiwindow/qmlmultiwindow.qrc @@ -0,0 +1,7 @@ + + + qml/qmlmultiwindow/Data.qml + qml/qmlmultiwindow/main.qml + qml/qmlmultiwindow/NewButton.qml + + diff --git a/tests/tests.pro b/tests/tests.pro index ec28d997..613534e9 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -13,7 +13,8 @@ SUBDIRS += barstest \ qmlcamera \ qmldynamicdata \ multigraphs \ - directional + directional \ + qmlmultiwindow #SUBDIRS += kinectsurface -- cgit v1.2.3 From dbeedae6e4e8463732ae86d3ba4828c559681b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 28 Feb 2014 13:19:38 +0200 Subject: Mac compilation fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9203e511d9d50af4d7bb2127af790df4c74fa9b2 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/enumtostringmap.cpp | 4 +++- src/datavisualizationqml2/enumtostringmap_p.h | 6 +++++- src/datavisualizationqml2/glstatestore_p.h | 4 ---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/datavisualizationqml2/enumtostringmap.cpp b/src/datavisualizationqml2/enumtostringmap.cpp index fd68c6bb..249fbae3 100644 --- a/src/datavisualizationqml2/enumtostringmap.cpp +++ b/src/datavisualizationqml2/enumtostringmap.cpp @@ -19,6 +19,8 @@ #include #include +#ifdef VERBOSE_STATE_STORE + static EnumToStringMap *theInstance = 0; static unsigned int theInstanceCount = 0; @@ -390,4 +392,4 @@ QString EnumToStringMap::lookUp(const GLuint value) const return QString("0x0%1").arg(value, 0, 16); } - +#endif diff --git a/src/datavisualizationqml2/enumtostringmap_p.h b/src/datavisualizationqml2/enumtostringmap_p.h index 2206f153..4ef9d32f 100644 --- a/src/datavisualizationqml2/enumtostringmap_p.h +++ b/src/datavisualizationqml2/enumtostringmap_p.h @@ -29,6 +29,10 @@ #ifndef ENUMTOSTRINGMAP_P_H #define ENUMTOSTRINGMAP_P_H +//#define VERBOSE_STATE_STORE + +#ifdef VERBOSE_STATE_STORE + #include #include #include @@ -45,5 +49,5 @@ private: QMap m_map; QString m_unknown; }; - +#endif #endif diff --git a/src/datavisualizationqml2/glstatestore_p.h b/src/datavisualizationqml2/glstatestore_p.h index 560598bf..14c46c43 100644 --- a/src/datavisualizationqml2/glstatestore_p.h +++ b/src/datavisualizationqml2/glstatestore_p.h @@ -29,14 +29,10 @@ #ifndef GLSTATESTORE_P_H #define GLSTATESTORE_P_H -//#define VERBOSE_STATE_STORE - #include #include #include -#ifdef VERBOSE_STATE_STORE #include "enumtostringmap_p.h" -#endif class GLStateStore : public QObject, protected QOpenGLFunctions { -- cgit v1.2.3 From 478b96d840750abaadbc6bdfcbcd7c9c04449117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 28 Feb 2014 13:24:14 +0200 Subject: Mac shared context bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3c3865eca8c2aadbb1de871e477f29495244b5a4 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/abstractdeclarative_p.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/datavisualizationqml2/abstractdeclarative_p.h b/src/datavisualizationqml2/abstractdeclarative_p.h index ac8bf9be..cfe62e3c 100644 --- a/src/datavisualizationqml2/abstractdeclarative_p.h +++ b/src/datavisualizationqml2/abstractdeclarative_p.h @@ -29,25 +29,25 @@ #ifndef ABSTRACTDECLARATIVE_P_H #define ABSTRACTDECLARATIVE_P_H -#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) -#define USE_SHARED_CONTEXT -#endif - #include "datavisualizationglobal_p.h" #include "abstract3dcontroller_p.h" #include "qabstract3dinputhandler.h" #include "declarativescene_p.h" -#ifndef USE_SHARED_CONTEXT -#include "glstatestore_p.h" -#endif - #include #include #include #include #include +#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) +#define USE_SHARED_CONTEXT +#endif + +#ifndef USE_SHARED_CONTEXT +#include "glstatestore_p.h" +#endif + QT_BEGIN_NAMESPACE_DATAVISUALIZATION class DeclarativeRenderNode; -- cgit v1.2.3 From e0731bfb32188f1b5ae6eed43094cb6eb62efc8c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 28 Feb 2014 14:35:03 +0200 Subject: Remove the invalid renderer deletion from context switch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Multiwindow case is still broken, though. Added note to code about it. Change-Id: Iec381d362469a8b2cf998c52f807b5c855526b22 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/abstractdeclarative.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp index e7a5c7eb..e517c177 100644 --- a/src/datavisualizationqml2/abstractdeclarative.cpp +++ b/src/datavisualizationqml2/abstractdeclarative.cpp @@ -239,14 +239,7 @@ void AbstractDeclarative::activateOpenGLContext(QQuickWindow *window) if (!m_context || !m_qtContext || m_contextWindow != window) { QOpenGLContext *currentContext = QOpenGLContext::currentContext(); - if (m_context && currentContext != m_qtContext) { - // If Qt context has changed, the old renderer needs to go. - // If the old context window no longer exists, it is okay to delete renderer - // in null context, as we can assume Qt context for the window is also gone. - m_context->makeCurrent(m_contextWindow); - m_controller->destroyRenderer(); - m_context->doneCurrent(); // So that we don't delete active context - } + // Note: Changing graph to different window when using multithreaded renderer will break! delete m_context; @@ -270,20 +263,14 @@ void AbstractDeclarative::activateOpenGLContext(QQuickWindow *window) if (!m_stateStore || !m_qtContext || m_contextWindow != window) { QOpenGLContext *currentContext = QOpenGLContext::currentContext(); - if (m_qtContext && currentContext != m_qtContext) { - // If Qt context has changed but still exists, the old renderer needs to go. - // If the old context window no longer exists, it is okay to delete renderer - // in null context (though it is likely Qt context is gone in that case, too.) - m_qtContext->makeCurrent(m_contextWindow); - m_controller->destroyRenderer(); - currentContext->makeCurrent(window); - } + // Note: Changing graph to different window when using multithreaded renderer will break! + + delete m_stateStore; m_contextThread = QThread::currentThread(); m_contextWindow = window; m_qtContext = currentContext; - delete m_stateStore; m_stateStore = new GLStateStore(QOpenGLContext::currentContext()); m_stateStore->storeGLState(); -- cgit v1.2.3 From b53ca48af0948a9b32ad93a4f6ca1ddb6ff58b5a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 28 Feb 2014 14:42:54 +0200 Subject: Readme additions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I98c5ff7bba0e7f28899c923c95900978acf7f8cc Reviewed-by: Tomi Korpipää --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index d17987d0..d6b4d1de 100644 --- a/README +++ b/README @@ -80,4 +80,5 @@ Known Issues - The color style Q3DTheme::ColorStyleObjectGradient doesn't work for surface graphs. - Scatter "point" meshes do not support gradients, they always use the base color. - Widget based examples layout incorrectly in iOS. -- QML implementation doesn't use a shared context on OSX. +- QML implementation doesn't use a shared context on OSX or Android. +- Reparenting a graph to an item in another QQuickWindow is not supported. -- cgit v1.2.3 From 3347c6537f1c2c6f070a28c1b5d23fa1ceb3a50f Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Fri, 28 Feb 2014 17:43:42 +0200 Subject: Round viewport to nearest integer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTRD-2905 Change-Id: I4a922544c72fede663379e19c49f31de77c6a767 Reviewed-by: Miikka Heikkinen Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/abstractdeclarative.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp index e517c177..de5aa9aa 100644 --- a/src/datavisualizationqml2/abstractdeclarative.cpp +++ b/src/datavisualizationqml2/abstractdeclarative.cpp @@ -404,12 +404,13 @@ void AbstractDeclarative::updateWindowParameters() if (directRender) { // Origin mapping is needed when rendering directly to background QPointF point = QQuickItem::mapToScene(QPointF(0.0, 0.0)); - scene->d_ptr->setViewport(QRect(point.x(), point.y(), m_cachedGeometry.width(), - m_cachedGeometry.height())); + scene->d_ptr->setViewport(QRect(point.x() + 0.5f, point.y() + 0.5f, + m_cachedGeometry.width() + 0.5f, + m_cachedGeometry.height() + 0.5f)); } else { // No translation needed when rendering to FBO - scene->d_ptr->setViewport(QRect(0.0, 0.0, m_cachedGeometry.width(), - m_cachedGeometry.height())); + scene->d_ptr->setViewport(QRect(0.0, 0.0, m_cachedGeometry.width() + 0.5f, + m_cachedGeometry.height() + 0.5f)); } } } -- cgit v1.2.3 From 7206dc36f1be77515cf6759795b265c986b2e20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Mon, 3 Mar 2014 13:34:07 +0200 Subject: Disallow clearing all draw flags Task-number: QTRD-2907 Change-Id: I89a45971bf67c533ecfe477cd685812c46574dd8 Reviewed-by: Miikka Heikkinen --- .../qmlsurface/qml/qmlsurface/main.qml | 20 ++++++++++++++++---- src/datavisualization/data/qsurface3dseries.cpp | 20 ++++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml index c38c3146..f11d15f3 100644 --- a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml +++ b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml @@ -97,6 +97,8 @@ Rectangle { onFlatShadingSupportedChanged: { flatShadingToggle.text = "Flat not supported" } + + onDrawModeChanged: checkState() } //! [4] Surface3DSeries { @@ -113,6 +115,8 @@ Rectangle { minXValue: 67 maxXValue: 97 } + + onDrawModeChanged: checkState() } //! [4] } @@ -135,11 +139,9 @@ Rectangle { if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe) { surfaceSeries.drawMode &= ~Surface3DSeries.DrawWireframe; heightSeries.drawMode &= ~Surface3DSeries.DrawWireframe; - text = "Show Surface Grid" } else { surfaceSeries.drawMode |= Surface3DSeries.DrawWireframe; heightSeries.drawMode |= Surface3DSeries.DrawWireframe; - text = "Hide Surface Grid" } } //! [1] @@ -155,11 +157,9 @@ Rectangle { if (surfaceSeries.drawMode & Surface3DSeries.DrawSurface) { surfaceSeries.drawMode &= ~Surface3DSeries.DrawSurface; heightSeries.drawMode &= ~Surface3DSeries.DrawSurface; - text = "Show Surface" } else { surfaceSeries.drawMode |= Surface3DSeries.DrawSurface; heightSeries.drawMode |= Surface3DSeries.DrawSurface; - text = "Hide Surface" } } //! [8] @@ -242,4 +242,16 @@ Rectangle { //! [3] } } + + function checkState() { + if (surfaceSeries.drawMode & Surface3DSeries.DrawSurface) + surfaceToggle.text = "Hide Surface" + else + surfaceToggle.text = "Show Surface" + + if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe) + surfaceGridToggle.text = "Hide Surface Grid" + else + surfaceGridToggle.text = "Show Surface Grid" + } } diff --git a/src/datavisualization/data/qsurface3dseries.cpp b/src/datavisualization/data/qsurface3dseries.cpp index 9518b0c4..c5ac9fe8 100644 --- a/src/datavisualization/data/qsurface3dseries.cpp +++ b/src/datavisualization/data/qsurface3dseries.cpp @@ -139,6 +139,13 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * Before then it is always true. */ +/*! + * \qmlproperty DrawFlag Surface3DSeries::drawMode + * + * Sets the drawing \a mode to one of \l{QSurface3DSeries::DrawFlag}{Surface3DSeries.DrawFlag}. + * Clearing all flags is not allowed. + */ + /*! * \enum QSurface3DSeries::DrawFlag * @@ -283,7 +290,7 @@ bool QSurface3DSeries::isFlatShadingSupported() const /*! * \property QSurface3DSeries::drawMode * - * Sets the drawing \a mode to one of DrawFlag. + * Sets the drawing \a mode to one of DrawFlag. Clearing all flags is not allowed. */ void QSurface3DSeries::setDrawMode(DrawFlags mode) { @@ -389,9 +396,14 @@ void QSurface3DSeriesPrivate::setFlatShadingEnabled(bool enabled) void QSurface3DSeriesPrivate::setDrawMode(QSurface3DSeries::DrawFlags mode) { - m_drawMode = mode; - if (m_controller) - m_controller->markSeriesVisualsDirty(); + if (mode.testFlag(QSurface3DSeries::DrawWireframe) + || mode.testFlag(QSurface3DSeries::DrawSurface)) { + m_drawMode = mode; + if (m_controller) + m_controller->markSeriesVisualsDirty(); + } else { + qWarning("You may not clear all draw flags. Mode not changed."); + } } QT_END_NAMESPACE_DATAVISUALIZATION -- cgit v1.2.3 From b2e4f1485df801a9e7f3812a66e4e7fc6c578980 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 3 Mar 2014 13:49:27 +0200 Subject: Enable querying shadow support from graphs Also some example tweaking. Change-Id: If69e9d3617afc37b88fed4fd0e02ae19f0af7f78 Reviewed-by: Mika Salmela --- .../datavisualization/qmlbars/qml/qmlbars/main.qml | 3 ++- .../qmlcustominput/qml/qmlcustominput/main.qml | 3 ++- .../qmllegend/qml/qmllegend/main.qml | 21 ++++++++++++--------- .../qmloscilloscope/qml/qmloscilloscope/main.qml | 2 +- .../qmlscatter/qml/qmlscatter/main.qml | 3 ++- .../qmlsurface/qml/qmlsurface/main.qml | 7 +------ .../qmlsurfacelayers/qml/qmlsurfacelayers/main.qml | 3 ++- ...qtdatavisualization-qml-abstractdeclarative.qdoc | 6 ++++++ .../engine/abstract3dcontroller.cpp | 9 +++++++++ .../engine/abstract3dcontroller_p.h | 1 + src/datavisualization/engine/qabstract3dgraph.cpp | 9 +++++++++ src/datavisualization/engine/qabstract3dgraph.h | 1 + src/datavisualizationqml2/abstractdeclarative.cpp | 5 +++++ src/datavisualizationqml2/abstractdeclarative_p.h | 4 ++++ 14 files changed, 57 insertions(+), 20 deletions(-) diff --git a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml index 3711a504..0df8d8ae 100644 --- a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml +++ b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml @@ -210,8 +210,9 @@ Rectangle { id: shadowToggle Layout.fillWidth: true Layout.fillHeight: true - text: "Hide Shadows" + text: barGraph.shadowsSupported ? "Hide Shadows" : "Shadows not supported" clip: true + enabled: barGraph.shadowsSupported onClicked: { if (barGraph.shadowQuality == AbstractGraph3D.ShadowQualityNone) { barGraph.shadowQuality = AbstractGraph3D.ShadowQualityMedium; diff --git a/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml b/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml index e81dd749..bdabb420 100644 --- a/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml +++ b/examples/datavisualization/qmlcustominput/qml/qmlcustominput/main.qml @@ -190,7 +190,8 @@ Rectangle { id: shadowToggle Layout.fillHeight: true Layout.minimumWidth: parent.width / 3 // 3 buttons divided equally in the layout - text: "Hide Shadows" + text: scatterGraph.shadowsSupported ? "Hide Shadows" : "Shadows not supported" + enabled: scatterGraph.shadowsSupported onClicked: { if (scatterGraph.shadowQuality === AbstractGraph3D.ShadowQualityNone) { diff --git a/examples/datavisualization/qmllegend/qml/qmllegend/main.qml b/examples/datavisualization/qmllegend/qml/qmllegend/main.qml index 6999a67b..f7e2d803 100644 --- a/examples/datavisualization/qmllegend/qml/qmllegend/main.qml +++ b/examples/datavisualization/qmllegend/qml/qmllegend/main.qml @@ -45,10 +45,7 @@ Rectangle { Item { id: dataView - anchors.top: buttonLayout.bottom - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right + anchors.fill: parent Bars3D { id: barGraph @@ -99,12 +96,18 @@ Rectangle { Rectangle { property int legendLocation: 3 + // Make the height and width fractional of main view height and width. + // Reverse the relation if screen is in portrait - this makes legend look the same + // if the orientation is rotated. + property int fractionalHeight: mainView.width > mainView.height ? mainView.height / 5 : mainView.width / 5 + property int fractionalWidth: mainView.width > mainView.height ? mainView.width / 5 : mainView.height / 5 id: legendPanel - width: 200 - height: 100 + width: fractionalWidth > 150 ? fractionalWidth : 150 + // Adjust legendpanel height to avoid gaps between layouted items. + height: fractionalHeight > 99 ? fractionalHeight - fractionalHeight % 3 : 99 border.color: barGraph.theme.labelTextColor - border.width: 2 + border.width: 3 color: "#00000000" // Transparent //! [0] @@ -152,7 +155,7 @@ Rectangle { when: legendPanel.legendLocation === 1 AnchorChanges { target: legendPanel - anchors.top: dataView.top + anchors.top: buttonLayout.bottom anchors.bottom: undefined anchors.left: dataView.left anchors.right: undefined @@ -163,7 +166,7 @@ Rectangle { when: legendPanel.legendLocation === 2 AnchorChanges { target: legendPanel - anchors.top: dataView.top + anchors.top: buttonLayout.bottom anchors.bottom: undefined anchors.left: undefined anchors.right: dataView.right diff --git a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml index eeaeab40..81884154 100644 --- a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -239,7 +239,7 @@ Item { Layout.fillHeight: true Layout.fillWidth: true - text: "Show Flat" + text: surfaceSeries.flatShadingSupported ? "Show Flat" : "Flat not supported" enabled: surfaceSeries.flatShadingSupported onClicked: { diff --git a/examples/datavisualization/qmlscatter/qml/qmlscatter/main.qml b/examples/datavisualization/qmlscatter/qml/qmlscatter/main.qml index 69cb2834..6664dcfd 100644 --- a/examples/datavisualization/qmlscatter/qml/qmlscatter/main.qml +++ b/examples/datavisualization/qmlscatter/qml/qmlscatter/main.qml @@ -139,7 +139,8 @@ Rectangle { id: shadowToggle Layout.fillHeight: true Layout.fillWidth: true - text: "Hide Shadows" + text: scatterGraph.shadowsSupported ? "Hide Shadows" : "Shadows not supported" + enabled: scatterGraph.shadowsSupported onClicked: { if (scatterGraph.shadowQuality === AbstractGraph3D.ShadowQualityNone) { scatterGraph.shadowQuality = AbstractGraph3D.ShadowQualitySoftLow; diff --git a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml index f11d15f3..6eef6cc4 100644 --- a/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml +++ b/examples/datavisualization/qmlsurface/qml/qmlsurface/main.qml @@ -93,11 +93,6 @@ Rectangle { yPosRole: "height" } //! [6] - - onFlatShadingSupportedChanged: { - flatShadingToggle.text = "Flat not supported" - } - onDrawModeChanged: checkState() } //! [4] @@ -169,7 +164,7 @@ Rectangle { id: flatShadingToggle Layout.fillWidth: true Layout.fillHeight: true - text: "Show Flat" + text: surfaceSeries.flatShadingSupported ? "Show Flat" : "Flat not supported" enabled: surfaceSeries.flatShadingSupported //! [2] onClicked: { diff --git a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml index 0be991bc..1c15d919 100644 --- a/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml +++ b/examples/datavisualization/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml @@ -217,9 +217,10 @@ Item { NewButton { id: shadowButton - text: "Show Shadows" Layout.fillWidth: true Layout.minimumHeight: 40 + text: surfaceLayers.shadowsSupported ? "Show Shadows" : "Shadows not supported" + enabled: surfaceLayers.shadowsSupported onClicked: { if (surfaceLayers.shadowQuality === AbstractGraph3D.ShadowQualityNone) { surfaceLayers.shadowQuality = AbstractGraph3D.ShadowQualityLow diff --git a/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc b/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc index 5b251768..891cc5c1 100644 --- a/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization-qml-abstractdeclarative.qdoc @@ -44,6 +44,12 @@ Shadow quality. */ +/*! + \qmlproperty bool AbstractGraph3D::shadowsSupported + This read-only property indicates if shadows are supported with the + current configuration or not. OpenGL ES2 configurations do not support shadows. + */ + /*! \qmlproperty Scene3D AbstractGraph3D::scene Read only Q3DScene that can be used to access e.g. camera object. diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index acb63f0a..ec18a850 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -730,6 +730,15 @@ QAbstract3DGraph::ShadowQuality Abstract3DController::shadowQuality() const return m_shadowQuality; } +bool Abstract3DController::shadowsSupported() const +{ +#if defined(QT_OPENGL_ES_2) + return false; +#else + return true; +#endif +} + bool Abstract3DController::isSlicingActive() const { return m_scene->isSlicingActive(); diff --git a/src/datavisualization/engine/abstract3dcontroller_p.h b/src/datavisualization/engine/abstract3dcontroller_p.h index 5bae17d6..06be450e 100644 --- a/src/datavisualization/engine/abstract3dcontroller_p.h +++ b/src/datavisualization/engine/abstract3dcontroller_p.h @@ -202,6 +202,7 @@ public: virtual void setShadowQuality(QAbstract3DGraph::ShadowQuality quality); virtual QAbstract3DGraph::ShadowQuality shadowQuality() const; + virtual bool shadowsSupported() const; bool isSlicingActive() const; void setSlicingActive(bool isSlicing); diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index cce2c235..bde5b585 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -330,6 +330,15 @@ QAbstract3DGraph::ShadowQuality QAbstract3DGraph::shadowQuality() const return d_ptr->m_visualController->shadowQuality(); } +/*! + * \return true if shadows are supported with the current configuration. + * OpenGL ES2 configurations do not support shadows. + */ +bool QAbstract3DGraph::shadowsSupported() const +{ + return d_ptr->m_visualController->shadowsSupported(); +} + /*! * \property QAbstract3DGraph::scene * diff --git a/src/datavisualization/engine/qabstract3dgraph.h b/src/datavisualization/engine/qabstract3dgraph.h index adf67912..f11bbd90 100644 --- a/src/datavisualization/engine/qabstract3dgraph.h +++ b/src/datavisualization/engine/qabstract3dgraph.h @@ -89,6 +89,7 @@ public: void setShadowQuality(ShadowQuality quality); ShadowQuality shadowQuality() const; + virtual bool shadowsSupported() const; Q3DScene *scene() const; diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp index de5aa9aa..d07ea540 100644 --- a/src/datavisualizationqml2/abstractdeclarative.cpp +++ b/src/datavisualizationqml2/abstractdeclarative.cpp @@ -202,6 +202,11 @@ AbstractDeclarative::ShadowQuality AbstractDeclarative::shadowQuality() const return ShadowQuality(m_controller->shadowQuality()); } +bool AbstractDeclarative::shadowsSupported() const +{ + return m_controller->shadowsSupported(); +} + void AbstractDeclarative::setSharedController(Abstract3DController *controller) { Q_ASSERT(controller); diff --git a/src/datavisualizationqml2/abstractdeclarative_p.h b/src/datavisualizationqml2/abstractdeclarative_p.h index cfe62e3c..428ca0b5 100644 --- a/src/datavisualizationqml2/abstractdeclarative_p.h +++ b/src/datavisualizationqml2/abstractdeclarative_p.h @@ -60,6 +60,7 @@ class AbstractDeclarative : public QQuickItem Q_FLAGS(SelectionFlag SelectionFlags) Q_PROPERTY(SelectionFlags selectionMode READ selectionMode WRITE setSelectionMode NOTIFY selectionModeChanged) Q_PROPERTY(ShadowQuality shadowQuality READ shadowQuality WRITE setShadowQuality NOTIFY shadowQualityChanged) + Q_PROPERTY(bool shadowsSupported READ shadowsSupported NOTIFY shadowsSupportedChanged) Q_PROPERTY(int msaaSamples READ msaaSamples WRITE setMsaaSamples NOTIFY msaaSamplesChanged) Q_PROPERTY(Declarative3DScene* scene READ scene NOTIFY sceneChanged) Q_PROPERTY(QAbstract3DInputHandler* inputHandler READ inputHandler WRITE setInputHandler NOTIFY inputHandlerChanged) @@ -110,6 +111,8 @@ public: virtual void setShadowQuality(ShadowQuality quality); virtual AbstractDeclarative::ShadowQuality shadowQuality() const; + virtual bool shadowsSupported() const; + virtual void setMsaaSamples(int samples); virtual int msaaSamples() const; @@ -158,6 +161,7 @@ protected: signals: void selectionModeChanged(SelectionFlags mode); void shadowQualityChanged(ShadowQuality quality); + void shadowsSupportedChanged(bool supported); void msaaSamplesChanged(int samples); void sceneChanged(Q3DScene *scene); void inputHandlerChanged(QAbstract3DInputHandler *inputHandler); -- cgit v1.2.3 From d911a8fe40b660c94589c4f0d6528381b9fc8d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 4 Mar 2014 07:45:23 +0200 Subject: Example tweak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibecb504d6186a2e86ab4aa267785c46f752f335b Change-Id: Ibecb504d6186a2e86ab4aa267785c46f752f335b Reviewed-by: Tomi Korpipää --- examples/datavisualization/customproxy/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/datavisualization/customproxy/main.cpp b/examples/datavisualization/customproxy/main.cpp index 4ec67f4b..c9a907f6 100644 --- a/examples/datavisualization/customproxy/main.cpp +++ b/examples/datavisualization/customproxy/main.cpp @@ -27,7 +27,7 @@ int main(int argc, char **argv) Q3DBars *rainfall = new Q3DBars; rainfall->setFlags(rainfall->flags() ^ Qt::FramelessWindowHint); - rainfall->resize(1280, 800); + rainfall->resize(1000, 800); rainfall->setPosition(QPoint(10, 30)); rainfall->show(); -- cgit v1.2.3 From 94cc9cddb377467029cd79141d84e39ccc94215d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 4 Mar 2014 08:15:28 +0200 Subject: Removed designer properties that do not work yet Made a jira task to put them back once the issue has been fixed Change-Id: I4fbd40a739b7cf811d20f511ec0d870a676c0b7c Change-Id: I4fbd40a739b7cf811d20f511ec0d870a676c0b7c Reviewed-by: Miikka Heikkinen --- .../designer/Bars3DSpecifics.qml | 40 ---------------------- 1 file changed, 40 deletions(-) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index ce07f88c..4bb84660 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -41,46 +41,6 @@ Column { Layout.fillWidth: true } } - Label { - text: qsTr("barThickness") - toolTip: qsTr("Bar Thickness Ratio") - Layout.fillWidth: true - } - SecondColumnLayout { - SpinBox { - backendValue: backendValues.barThickness // Why does this export value as string? - minimumValue: 0.001 - maximumValue: 10.0 - stepSize: 0.001 - decimals: 3 - Layout.fillWidth: true - } - } - Label { - text: qsTr("barSpacing") - toolTip: qsTr("Bar Spacing") - Layout.fillWidth: true - } - SecondColumnLayout { - SpinBox { - prefix: "col: " - backendValue: backendValues.barSpacing.width // Does not work - minimumValue: 0.0 - maximumValue: 10.0 - stepSize: 0.01 - decimals: 2 - Layout.fillWidth: true - } - SpinBox { - prefix: "row: " - backendValue: backendValues.barSpacing.height // Does not work - minimumValue: 0.0 - maximumValue: 10.0 - stepSize: 0.01 - decimals: 2 - Layout.fillWidth: true - } - } Label { text: qsTr("barSpacingRelative") toolTip: qsTr("Bar Spacing Relative") -- cgit v1.2.3 From 1c4e4e0b52e8868ae4a28fc66c2acd4eacfc503e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 4 Mar 2014 08:48:02 +0200 Subject: Added default size to designer components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5aa7f75aafd3437c1f5389b3ffbbb47cdde02d8e Change-Id: I5aa7f75aafd3437c1f5389b3ffbbb47cdde02d8e Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/designer/qtdatavisualization.metainfo | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/datavisualizationqml2/designer/qtdatavisualization.metainfo b/src/datavisualizationqml2/designer/qtdatavisualization.metainfo index 0d7b14be..3d4e61a8 100644 --- a/src/datavisualizationqml2/designer/qtdatavisualization.metainfo +++ b/src/datavisualizationqml2/designer/qtdatavisualization.metainfo @@ -9,6 +9,9 @@ MetaInfo { libraryIcon: "images/bars3d-icon.png" version: "1.0" requiredImport: "QtDataVisualization" + + Property { name: "width"; type: "int"; value: 300; } + Property { name: "height"; type: "int"; value: 300; } } } Type { @@ -21,6 +24,9 @@ MetaInfo { libraryIcon: "images/scatter3d-icon.png" version: "1.0" requiredImport: "QtDataVisualization" + + Property { name: "width"; type: "int"; value: 300; } + Property { name: "height"; type: "int"; value: 300; } } } Type { @@ -33,6 +39,9 @@ MetaInfo { libraryIcon: "images/surface3d-icon.png" version: "1.0" requiredImport: "QtDataVisualization" + + Property { name: "width"; type: "int"; value: 300; } + Property { name: "height"; type: "int"; value: 300; } } } } -- cgit v1.2.3 From 45b4df0eab8bc2a140650de7a4aa9b8f61307e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 4 Mar 2014 09:06:26 +0200 Subject: Specifics typo bug fix Change-Id: I19c1bec9a7c562d3bcd510ba7faa20a0773eb6a5 Change-Id: I19c1bec9a7c562d3bcd510ba7faa20a0773eb6a5 Reviewed-by: Miikka Heikkinen --- src/datavisualizationqml2/designer/Bars3DSpecifics.qml | 4 ++-- src/datavisualizationqml2/designer/Scatter3DSpecifics.qml | 4 ++-- src/datavisualizationqml2/designer/Surface3DSpecifics.qml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index 4bb84660..708e8213 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -60,8 +60,8 @@ Column { SecondColumnLayout { ComboBox { backendValue: backendValues.renderingMode - model: ["RenderIndirect", "RenderDirectoToBackground", - "RenderDirectoToBackground_NoClear"] + model: ["RenderIndirect", "RenderDirectToBackground", + "RenderDirectToBackground_NoClear"] Layout.fillWidth: true } } diff --git a/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml b/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml index 9ba6bf00..b7b2f1f5 100644 --- a/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml @@ -38,8 +38,8 @@ Column { SecondColumnLayout { ComboBox { backendValue: backendValues.renderingMode - model: ["RenderIndirect", "RenderDirectoToBackground", - "RenderDirectoToBackground_NoClear"] + model: ["RenderIndirect", "RenderDirectToBackground", + "RenderDirectToBackground_NoClear"] Layout.fillWidth: true } } diff --git a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml index edd109e0..c6c634b4 100644 --- a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml @@ -38,8 +38,8 @@ Column { SecondColumnLayout { ComboBox { backendValue: backendValues.renderingMode - model: ["RenderIndirect", "RenderDirectoToBackground", - "RenderDirectoToBackground_NoClear"] + model: ["RenderIndirect", "RenderDirectToBackground", + "RenderDirectToBackground_NoClear"] Layout.fillWidth: true } } -- cgit v1.2.3 From 810679bbae04d9ae693120e6398ab205fdfbbd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 4 Mar 2014 09:20:51 +0200 Subject: Minimal qml surface example bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib1598adbf906ba13bf538981abdd60fe0fda2e2c Change-Id: Ib1598adbf906ba13bf538981abdd60fe0fda2e2c Reviewed-by: Tomi Korpipää --- src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp b/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp index 8c38ca82..0c54c2fe 100644 --- a/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp +++ b/src/datavisualization/doc/snippets/doc_src_qmldatavisualization.cpp @@ -110,7 +110,7 @@ Item { // Mapping model roles to surface series rows, columns, and values. rowRole: "longitude" columnRole: "latitude" - valueRole: "pop_density" + yPosRole: "pop_density" } } } -- cgit v1.2.3 From a9747571470a03e5f8b01a233f222daef68488bc Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 4 Mar 2014 11:17:14 +0200 Subject: Fix category axis automatic range adjustment for simple bar graphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single row/column graphs added extra row when autoadjusting. Change-Id: Ie6b79257c33cbf4647fe4855e8cbc655052a133c Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/bars3dcontroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datavisualization/engine/bars3dcontroller.cpp b/src/datavisualization/engine/bars3dcontroller.cpp index 442601eb..91240259 100644 --- a/src/datavisualization/engine/bars3dcontroller.cpp +++ b/src/datavisualization/engine/bars3dcontroller.cpp @@ -509,8 +509,8 @@ void Bars3DController::adjustAxisRanges() bool adjustY = (valueAxis && categoryAxisX && categoryAxisZ && valueAxis->isAutoAdjustRange()); if (adjustZ || adjustX || adjustY) { - int maxRowCount = 1; - int maxColumnCount = 1; + int maxRowCount = 0; + int maxColumnCount = 0; float minValue = 0.0f; float maxValue = 0.0f; -- cgit v1.2.3 From 878a7e4ead91e81ce9796fb7035ca0fdbd54fee8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 4 Mar 2014 13:28:21 +0200 Subject: Default graphs for qmldesigner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +Some doc changes Change-Id: Id815f178e3321c6033f6782d75a99b54c656ca7a Reviewed-by: Tomi Korpipää --- .../data/qitemmodelsurfacedataproxy.cpp | 12 +++++-- .../designer/default/Bars3D.qml | 38 +++++++++++++++++++++ .../designer/default/Scatter3D.qml | 38 +++++++++++++++++++++ .../designer/default/Surface3D.qml | 39 ++++++++++++++++++++++ src/datavisualizationqml2/designer/designer.pri | 5 ++- .../designer/qtdatavisualization.metainfo | 9 ++--- 6 files changed, 131 insertions(+), 10 deletions(-) create mode 100644 src/datavisualizationqml2/designer/default/Bars3D.qml create mode 100644 src/datavisualizationqml2/designer/default/Scatter3D.qml create mode 100644 src/datavisualizationqml2/designer/default/Surface3D.qml diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp index 07d15d23..01645040 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * * 2) For models that do not have data already neatly sorted into rows and columns, such as * QAbstractListModel based models, you can define a role from the model to map for each of row, - * column and value. + * column and Y-position. * * 3) If you do not want to include all data contained in the model, or the autogenerated rows and * columns are not ordered as you wish, you can specify which rows and columns should be included @@ -109,7 +109,8 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty string ItemModelSurfaceDataProxy::xPosRole - * The X position role of the mapping. + * The X position role of the mapping. If this role is not defined, columnRole is used to + * determine the X-coordinate value of resolved QSurfaceDataItems. */ /*! @@ -119,7 +120,8 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty string ItemModelSurfaceDataProxy::zPosRole - * The Z position role of the mapping. + * The Z position role of the mapping. If this role is not defined, rowRole is used to + * determine the Z-coordinate value of resolved QSurfaceDataItems. */ /*! @@ -366,6 +368,8 @@ QString QItemModelSurfaceDataProxy::columnRole() const * \property QItemModelSurfaceDataProxy::xPosRole * * Defines the X position \a role for the mapping. + * If this role is not defined, columnRole is used to determine the X-coordinate + * value of resolved QSurfaceDataItems. */ void QItemModelSurfaceDataProxy::setXPosRole(const QString &role) { @@ -402,6 +406,8 @@ QString QItemModelSurfaceDataProxy::yPosRole() const * \property QItemModelSurfaceDataProxy::zPosRole * * Defines the Z position \a role for the mapping. + * If this role is not defined, rowRole is used to determine the Z-coordinate + * value of resolved QSurfaceDataItems. */ void QItemModelSurfaceDataProxy::setZPosRole(const QString &role) { diff --git a/src/datavisualizationqml2/designer/default/Bars3D.qml b/src/datavisualizationqml2/designer/default/Bars3D.qml new file mode 100644 index 00000000..9f8c72e3 --- /dev/null +++ b/src/datavisualizationqml2/designer/default/Bars3D.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Bars3D { + width: 300 + height: 300 + Bar3DSeries { + ItemModelBarDataProxy { + itemModel: ListModel { + ListElement{ row: "row 1"; column: "column 1"; value: "1"; } + ListElement{ row: "row 1"; column: "column 2"; value: "2"; } + ListElement{ row: "row 1"; column: "column 3"; value: "3"; } + } + + rowRole: "row" + columnRole: "column" + valueRole: "value" + } + } +} diff --git a/src/datavisualizationqml2/designer/default/Scatter3D.qml b/src/datavisualizationqml2/designer/default/Scatter3D.qml new file mode 100644 index 00000000..d38a9755 --- /dev/null +++ b/src/datavisualizationqml2/designer/default/Scatter3D.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Scatter3D { + width: 300 + height: 300 + Scatter3DSeries { + ItemModelScatterDataProxy { + itemModel: ListModel { + ListElement{ x: "1"; y: "2"; z: "3"; } + ListElement{ x: "2"; y: "3"; z: "4"; } + ListElement{ x: "3"; y: "4"; z: "1"; } + } + + xPosRole: "x" + yPosRole: "y" + zPosRole: "z" + } + } +} diff --git a/src/datavisualizationqml2/designer/default/Surface3D.qml b/src/datavisualizationqml2/designer/default/Surface3D.qml new file mode 100644 index 00000000..fde097df --- /dev/null +++ b/src/datavisualizationqml2/designer/default/Surface3D.qml @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 +** +****************************************************************************/ + +import QtQuick 2.0 +import QtDataVisualization 1.0 + +Surface3D { + width: 300 + height: 300 + Surface3DSeries { + ItemModelSurfaceDataProxy { + itemModel: ListModel { + ListElement{ row: "1"; column: "1"; y: "1"; } + ListElement{ row: "1"; column: "2"; y: "2"; } + ListElement{ row: "2"; column: "1"; y: "3"; } + ListElement{ row: "2"; column: "2"; y: "4"; } + } + + rowRole: "row" + columnRole: "column" + yPosRole: "y" + } + } +} diff --git a/src/datavisualizationqml2/designer/designer.pri b/src/datavisualizationqml2/designer/designer.pri index db7c9b96..e22fb618 100644 --- a/src/datavisualizationqml2/designer/designer.pri +++ b/src/datavisualizationqml2/designer/designer.pri @@ -1,7 +1,10 @@ QML_FILES += \ $$PWD/Bars3DSpecifics.qml \ $$PWD/Scatter3DSpecifics.qml \ - $$PWD/Surface3DSpecifics.qml + $$PWD/Surface3DSpecifics.qml \ + $$PWD/default/Bars3D.qml \ + $$PWD/default/Scatter3D.qml \ + $$PWD/default/Surface3D.qml QML_FILES += $$PWD/qtdatavisualization.metainfo diff --git a/src/datavisualizationqml2/designer/qtdatavisualization.metainfo b/src/datavisualizationqml2/designer/qtdatavisualization.metainfo index 3d4e61a8..60b2b2c2 100644 --- a/src/datavisualizationqml2/designer/qtdatavisualization.metainfo +++ b/src/datavisualizationqml2/designer/qtdatavisualization.metainfo @@ -10,8 +10,7 @@ MetaInfo { version: "1.0" requiredImport: "QtDataVisualization" - Property { name: "width"; type: "int"; value: 300; } - Property { name: "height"; type: "int"; value: 300; } + QmlSource { source: "default/Bars3D.qml" } } } Type { @@ -25,8 +24,7 @@ MetaInfo { version: "1.0" requiredImport: "QtDataVisualization" - Property { name: "width"; type: "int"; value: 300; } - Property { name: "height"; type: "int"; value: 300; } + QmlSource { source: "default/Scatter3D.qml" } } } Type { @@ -40,8 +38,7 @@ MetaInfo { version: "1.0" requiredImport: "QtDataVisualization" - Property { name: "width"; type: "int"; value: 300; } - Property { name: "height"; type: "int"; value: 300; } + QmlSource { source: "default/Surface3D.qml" } } } } -- cgit v1.2.3 From 2068d98d3f098d152fbec381fb95f8453bc949f1 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 4 Mar 2014 14:19:56 +0200 Subject: Make sure we don't draw empty graphs in designer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I90dac0c7c884326875dd4b58d71075fd316e47b8 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/abstractdeclarative.cpp | 7 ++++--- src/datavisualizationqml2/abstractdeclarative_p.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp index d07ea540..56cad310 100644 --- a/src/datavisualizationqml2/abstractdeclarative.cpp +++ b/src/datavisualizationqml2/abstractdeclarative.cpp @@ -54,7 +54,8 @@ AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : setAntialiasing(m_samples > 0); // Set contents to false in case we are in qml designer to make component look nice - setFlag(ItemHasContents, QGuiApplication::applicationDisplayName() != "Qml2Puppet"); + m_runningInDesigner = QGuiApplication::applicationDisplayName() == "Qml2Puppet"; + setFlag(ItemHasContents, !m_runningInDesigner); } AbstractDeclarative::~AbstractDeclarative() @@ -113,7 +114,7 @@ void AbstractDeclarative::setRenderingMode(AbstractDeclarative::RenderingMode mo break; case RenderIndirect: m_initialisedSize = QSize(0, 0); - setFlag(ItemHasContents, true); + setFlag(ItemHasContents, !m_runningInDesigner); update(); if (win) { QObject::disconnect(win, &QQuickWindow::beforeRendering, this, @@ -139,7 +140,7 @@ AbstractDeclarative::RenderingMode AbstractDeclarative::renderingMode() const QSGNode *AbstractDeclarative::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { QSize boundingSize = boundingRect().size().toSize() * m_controller->scene()->devicePixelRatio(); - if (boundingSize.width() <= 0 || boundingSize.height() <= 0 + if (m_runningInDesigner || boundingSize.width() <= 0 || boundingSize.height() <= 0 || m_controller.isNull() || !window()) { delete oldNode; return 0; diff --git a/src/datavisualizationqml2/abstractdeclarative_p.h b/src/datavisualizationqml2/abstractdeclarative_p.h index 428ca0b5..0a18dc25 100644 --- a/src/datavisualizationqml2/abstractdeclarative_p.h +++ b/src/datavisualizationqml2/abstractdeclarative_p.h @@ -184,6 +184,7 @@ private: QPointer m_qtContext; QThread *m_mainThread; QThread *m_contextThread; + bool m_runningInDesigner; }; Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractDeclarative::SelectionFlags) -- cgit v1.2.3 From 3d513480927fc1e2a72e71ce4ac48d7ac5e10fe4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 5 Mar 2014 10:43:21 +0200 Subject: Minor README tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need to talk about contexts in known issues, it shouldn't affect the user in any way. Also broadened the disclaimer about scene subviews not working. Change-Id: Ia887950f715116ee5384c477049fe42e13a9b9ba Reviewed-by: Tomi Korpipää --- README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README b/README index d6b4d1de..0d9d9971 100644 --- a/README +++ b/README @@ -76,9 +76,8 @@ Known Issues - Anti-aliasing doesn't work with OpenGL ES2 (including Angle builds in Windows). - Surfaces with non-straight rows and columns do not always render properly. - Q3DLight class (and Light3D QML item) are currently not usable for anything. -- Q3DScene::secondarySubviewOnTop property has currently no effect. +- Changing any of Q3DScene properties affecting subviewports currently has no effect. - The color style Q3DTheme::ColorStyleObjectGradient doesn't work for surface graphs. - Scatter "point" meshes do not support gradients, they always use the base color. - Widget based examples layout incorrectly in iOS. -- QML implementation doesn't use a shared context on OSX or Android. - Reparenting a graph to an item in another QQuickWindow is not supported. -- cgit v1.2.3 From 21febc677c350da772dee92d32dd268c762ae483 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 5 Mar 2014 11:11:42 +0200 Subject: Make bar graph horizontal labels transparent to vertical labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie86f773551fe798b8476d3947e2b9d88bbe3855c Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/bars3drenderer.cpp | 127 ++++++++++++------------ 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index be1be0dc..78d80e47 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -1652,6 +1652,70 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_POLYGON_OFFSET_FILL); + // Y Labels + int labelNbr = 0; + GLfloat heightStep = m_axisCacheY.segmentStep(); + GLfloat startLine = 0.0f; + int labelCount = m_axisCacheY.labels().size(); + if (m_hasNegativeValues) { + if (m_noZeroInRange) + startLine = m_axisCacheY.min() - m_axisCacheY.max(); + else + startLine = m_axisCacheY.min(); + } + GLfloat labelPos = startLine; + GLfloat labelMarginXTrans = labelMargin; + GLfloat labelMarginZTrans = labelMargin; + GLfloat labelXTrans = rowScaleFactor; + GLfloat labelZTrans = columnScaleFactor; + QVector3D backLabelRotation(0.0f, -90.0f, 0.0f); + QVector3D sideLabelRotation(0.0f, 0.0f, 0.0f); + Qt::AlignmentFlag backAlignment = Qt::AlignLeft; + Qt::AlignmentFlag sideAlignment = Qt::AlignLeft; + if (!m_xFlipped) { + labelXTrans = -labelXTrans; + labelMarginXTrans = -labelMargin; + backLabelRotation.setY(90.0f); + sideAlignment = Qt::AlignRight; + } + if (m_zFlipped) { + labelZTrans = -labelZTrans; + labelMarginZTrans = -labelMargin; + backAlignment = Qt::AlignRight; + sideLabelRotation.setY(180.f); + } + QVector3D backLabelTrans = QVector3D(labelXTrans, 0.0f, + labelZTrans + labelMarginZTrans); + QVector3D sideLabelTrans = QVector3D(-labelXTrans - labelMarginXTrans, + 0.0f, -labelZTrans); + + for (int i = 0; i < labelCount; i++) { + if (m_axisCacheY.labelItems().size() > labelNbr) { + backLabelTrans.setY(2.0f * labelPos / m_heightNormalizer); + sideLabelTrans.setY(backLabelTrans.y()); + + glPolygonOffset(GLfloat(i) / -10.0f, 1.0f); + + const LabelItem &axisLabelItem = *m_axisCacheY.labelItems().at(labelNbr); + + // Back wall + m_dummyBarRenderItem.setTranslation(backLabelTrans); + m_drawer->drawLabel(m_dummyBarRenderItem, axisLabelItem, viewMatrix, projectionMatrix, + zeroVector, backLabelRotation, 0, m_cachedSelectionMode, + m_labelShader, m_labelObj, activeCamera, + true, true, Drawer::LabelMid, backAlignment); + + // Side wall + m_dummyBarRenderItem.setTranslation(sideLabelTrans); + m_drawer->drawLabel(m_dummyBarRenderItem, axisLabelItem, viewMatrix, projectionMatrix, + zeroVector, sideLabelRotation, 0, m_cachedSelectionMode, + m_labelShader, m_labelObj, activeCamera, + true, true, Drawer::LabelMid, sideAlignment); + } + labelNbr++; + labelPos += heightStep; + } + // Calculate the positions for row and column labels and store them GLfloat labelYAdjustment = 0.005f; GLfloat scaledRowWidth = rowScaleFactor; @@ -1733,69 +1797,6 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) } } - // Y Labels - int labelNbr = 0; - GLfloat heightStep = m_axisCacheY.segmentStep(); - GLfloat startLine = 0.0f; - int labelCount = m_axisCacheY.labels().size(); - if (m_hasNegativeValues) { - if (m_noZeroInRange) - startLine = m_axisCacheY.min() - m_axisCacheY.max(); - else - startLine = m_axisCacheY.min(); - } - GLfloat labelPos = startLine; - GLfloat labelMarginXTrans = labelMargin; - GLfloat labelMarginZTrans = labelMargin; - GLfloat labelXTrans = rowScaleFactor; - GLfloat labelZTrans = columnScaleFactor; - QVector3D backLabelRotation(0.0f, -90.0f, 0.0f); - QVector3D sideLabelRotation(0.0f, 0.0f, 0.0f); - Qt::AlignmentFlag backAlignment = Qt::AlignLeft; - Qt::AlignmentFlag sideAlignment = Qt::AlignLeft; - if (!m_xFlipped) { - labelXTrans = -labelXTrans; - labelMarginXTrans = -labelMargin; - backLabelRotation.setY(90.0f); - sideAlignment = Qt::AlignRight; - } - if (m_zFlipped) { - labelZTrans = -labelZTrans; - labelMarginZTrans = -labelMargin; - backAlignment = Qt::AlignRight; - sideLabelRotation.setY(180.f); - } - QVector3D backLabelTrans = QVector3D(labelXTrans, 0.0f, - labelZTrans + labelMarginZTrans); - QVector3D sideLabelTrans = QVector3D(-labelXTrans - labelMarginXTrans, - 0.0f, -labelZTrans); - - for (int i = 0; i < labelCount; i++) { - if (m_axisCacheY.labelItems().size() > labelNbr) { - backLabelTrans.setY(2.0f * labelPos / m_heightNormalizer); - sideLabelTrans.setY(backLabelTrans.y()); - - glPolygonOffset(GLfloat(i) / -10.0f, 1.0f); - - const LabelItem &axisLabelItem = *m_axisCacheY.labelItems().at(labelNbr); - - // Back wall - m_dummyBarRenderItem.setTranslation(backLabelTrans); - m_drawer->drawLabel(m_dummyBarRenderItem, axisLabelItem, viewMatrix, projectionMatrix, - zeroVector, backLabelRotation, 0, m_cachedSelectionMode, - m_labelShader, m_labelObj, activeCamera, - true, true, Drawer::LabelMid, backAlignment); - - // Side wall - m_dummyBarRenderItem.setTranslation(sideLabelTrans); - m_drawer->drawLabel(m_dummyBarRenderItem, axisLabelItem, viewMatrix, projectionMatrix, - zeroVector, sideLabelRotation, 0, m_cachedSelectionMode, - m_labelShader, m_labelObj, activeCamera, - true, true, Drawer::LabelMid, sideAlignment); - } - labelNbr++; - labelPos += heightStep; - } glDisable(GL_POLYGON_OFFSET_FILL); // Handle selected bar label generation -- cgit v1.2.3 From d5e3a84df4d0fe99241c9a3f34573cae2abd99ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Wed, 5 Mar 2014 12:19:00 +0200 Subject: Actual icons for designer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5ab858067d3fc921b9574d1d0dd1ca4987e6e251 Change-Id: I5ab858067d3fc921b9574d1d0dd1ca4987e6e251 Reviewed-by: Tomi Korpipää --- .../designer/images/bars3d-icon.png | Bin 784 -> 1352 bytes .../designer/images/bars3d-icon16.png | Bin 440 -> 1232 bytes .../designer/images/scatter3d-icon.png | Bin 880 -> 1271 bytes .../designer/images/scatter3d-icon16.png | Bin 474 -> 1146 bytes .../designer/images/surface3d-icon.png | Bin 941 -> 1413 bytes .../designer/images/surface3d-icon16.png | Bin 545 -> 1231 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/datavisualizationqml2/designer/images/bars3d-icon.png b/src/datavisualizationqml2/designer/images/bars3d-icon.png index 3312602e..7f380789 100644 Binary files a/src/datavisualizationqml2/designer/images/bars3d-icon.png and b/src/datavisualizationqml2/designer/images/bars3d-icon.png differ diff --git a/src/datavisualizationqml2/designer/images/bars3d-icon16.png b/src/datavisualizationqml2/designer/images/bars3d-icon16.png index b21c825e..e85ff502 100644 Binary files a/src/datavisualizationqml2/designer/images/bars3d-icon16.png and b/src/datavisualizationqml2/designer/images/bars3d-icon16.png differ diff --git a/src/datavisualizationqml2/designer/images/scatter3d-icon.png b/src/datavisualizationqml2/designer/images/scatter3d-icon.png index f8487a90..e1ac5c1f 100644 Binary files a/src/datavisualizationqml2/designer/images/scatter3d-icon.png and b/src/datavisualizationqml2/designer/images/scatter3d-icon.png differ diff --git a/src/datavisualizationqml2/designer/images/scatter3d-icon16.png b/src/datavisualizationqml2/designer/images/scatter3d-icon16.png index 6fb41943..75b2db18 100644 Binary files a/src/datavisualizationqml2/designer/images/scatter3d-icon16.png and b/src/datavisualizationqml2/designer/images/scatter3d-icon16.png differ diff --git a/src/datavisualizationqml2/designer/images/surface3d-icon.png b/src/datavisualizationqml2/designer/images/surface3d-icon.png index bc1e4ee0..956c675e 100644 Binary files a/src/datavisualizationqml2/designer/images/surface3d-icon.png and b/src/datavisualizationqml2/designer/images/surface3d-icon.png differ diff --git a/src/datavisualizationqml2/designer/images/surface3d-icon16.png b/src/datavisualizationqml2/designer/images/surface3d-icon16.png index 917dcdf9..6caa643e 100644 Binary files a/src/datavisualizationqml2/designer/images/surface3d-icon16.png and b/src/datavisualizationqml2/designer/images/surface3d-icon16.png differ -- cgit v1.2.3 From 8ff3478d50e7026b5620217327197465f9249759 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 10:18:29 +0100 Subject: Adding plugins.qmltypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is required for the Qt Creator code model. Change-Id: Ie0480751841aae59c2df7ae9b0470d5e068257e1 Reviewed-by: Miikka Heikkinen Reviewed-by: Tomi Korpipää --- .../datavisualizationqml2.pro | 3 + src/datavisualizationqml2/plugins.qmltypes | 1387 ++++++++++++++++++++ 2 files changed, 1390 insertions(+) create mode 100644 src/datavisualizationqml2/plugins.qmltypes diff --git a/src/datavisualizationqml2/datavisualizationqml2.pro b/src/datavisualizationqml2/datavisualizationqml2.pro index ed91b111..7c65d69e 100644 --- a/src/datavisualizationqml2/datavisualizationqml2.pro +++ b/src/datavisualizationqml2/datavisualizationqml2.pro @@ -60,3 +60,6 @@ load(qml_plugin) QMAKE_EXTRA_TARGETS += copy_qmldir PRE_TARGETDEPS += $$copy_qmldir.target } + +QML_FILES += \ + $$PWD/plugins.qmltypes diff --git a/src/datavisualizationqml2/plugins.qmltypes b/src/datavisualizationqml2/plugins.qmltypes new file mode 100644 index 00000000..7831ab43 --- /dev/null +++ b/src/datavisualizationqml2/plugins.qmltypes @@ -0,0 +1,1387 @@ +import QtQuick.tooling 1.1 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable QtDataVisualization 1.0' + +Module { + Component { + name: "QtDataVisualization::AbstractDeclarative" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtDataVisualization/AbstractGraph3D 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "SelectionFlag" + values: { + "SelectionNone": 0, + "SelectionItem": 1, + "SelectionRow": 2, + "SelectionItemAndRow": 3, + "SelectionColumn": 4, + "SelectionItemAndColumn": 5, + "SelectionRowAndColumn": 6, + "SelectionItemRowAndColumn": 7, + "SelectionSlice": 8, + "SelectionMultiSeries": 16 + } + } + Enum { + name: "SelectionFlags" + values: { + "SelectionNone": 0, + "SelectionItem": 1, + "SelectionRow": 2, + "SelectionItemAndRow": 3, + "SelectionColumn": 4, + "SelectionItemAndColumn": 5, + "SelectionRowAndColumn": 6, + "SelectionItemRowAndColumn": 7, + "SelectionSlice": 8, + "SelectionMultiSeries": 16 + } + } + Enum { + name: "ShadowQuality" + values: { + "ShadowQualityNone": 0, + "ShadowQualityLow": 1, + "ShadowQualityMedium": 2, + "ShadowQualityHigh": 3, + "ShadowQualitySoftLow": 4, + "ShadowQualitySoftMedium": 5, + "ShadowQualitySoftHigh": 6 + } + } + Enum { + name: "RenderingMode" + values: { + "RenderDirectToBackground": 0, + "RenderDirectToBackground_NoClear": 1, + "RenderIndirect": 2 + } + } + Property { name: "selectionMode"; type: "SelectionFlags" } + Property { name: "shadowQuality"; type: "ShadowQuality" } + Property { name: "msaaSamples"; type: "int" } + Property { name: "scene"; type: "Declarative3DScene"; isReadonly: true; isPointer: true } + Property { name: "inputHandler"; type: "QAbstract3DInputHandler"; isPointer: true } + Property { name: "theme"; type: "Q3DTheme"; isPointer: true } + Property { name: "renderingMode"; type: "RenderingMode" } + Signal { + name: "selectionModeChanged" + Parameter { name: "mode"; type: "SelectionFlags" } + } + Signal { + name: "shadowQualityChanged" + Parameter { name: "quality"; type: "ShadowQuality" } + } + Signal { + name: "msaaSamplesChanged" + Parameter { name: "samples"; type: "int" } + } + Signal { + name: "sceneChanged" + Parameter { name: "scene"; type: "Q3DScene"; isPointer: true } + } + Signal { + name: "inputHandlerChanged" + Parameter { name: "inputHandler"; type: "QAbstract3DInputHandler"; isPointer: true } + } + Signal { + name: "themeChanged" + Parameter { name: "theme"; type: "Q3DTheme"; isPointer: true } + } + Signal { + name: "renderingModeChanged" + Parameter { name: "mode"; type: "RenderingMode" } + } + Method { + name: "handleAxisXChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisYChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisZChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "windowDestroyed" + Parameter { name: "obj"; type: "QObject"; isPointer: true } + } + Method { name: "clearSelection" } + } + Component { + name: "QtDataVisualization::ColorGradient" + defaultProperty: "stops" + prototype: "QObject" + exports: ["QtDataVisualization/ColorGradient 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "stops"; type: "ColorGradientStop"; isList: true; isReadonly: true } + Signal { name: "updated" } + } + Component { + name: "QtDataVisualization::ColorGradientStop" + prototype: "QObject" + exports: ["QtDataVisualization/ColorGradientStop 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "position"; type: "double" } + Property { name: "color"; type: "QColor" } + Signal { + name: "positionChanged" + Parameter { name: "position"; type: "double" } + } + Signal { + name: "colorChanged" + Parameter { name: "color"; type: "QColor" } + } + } + Component { + name: "QtDataVisualization::Declarative3DScene" + prototype: "QtDataVisualization::Q3DScene" + exports: ["QtDataVisualization/Scene3D 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "selectionQueryPosition"; type: "QPointF" } + Property { name: "invalidSelectionPoint"; type: "QPoint"; isReadonly: true } + Signal { + name: "selectionQueryPositionChanged" + Parameter { name: "position"; type: "QPointF" } + } + } + Component { + name: "QtDataVisualization::DeclarativeBar3DSeries" + defaultProperty: "seriesChildren" + prototype: "QtDataVisualization::QBar3DSeries" + exports: ["QtDataVisualization/Bar3DSeries 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "selectedBar"; type: "QPointF" } + Property { name: "invalidSelectionPosition"; type: "QPointF"; isReadonly: true } + Property { name: "baseGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "singleHighlightGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "multiHighlightGradient"; type: "ColorGradient"; isPointer: true } + Signal { + name: "selectedBarChanged" + Parameter { name: "position"; type: "QPointF" } + } + Signal { + name: "baseGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Method { name: "handleBaseGradientUpdate" } + Method { name: "handleSingleHighlightGradientUpdate" } + Method { name: "handleMultiHighlightGradientUpdate" } + } + Component { + name: "QtDataVisualization::DeclarativeBars" + defaultProperty: "seriesList" + prototype: "QtDataVisualization::AbstractDeclarative" + exports: ["QtDataVisualization/Bars3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "rowAxis"; type: "QCategory3DAxis"; isPointer: true } + Property { name: "valueAxis"; type: "QValue3DAxis"; isPointer: true } + Property { name: "columnAxis"; type: "QCategory3DAxis"; isPointer: true } + Property { name: "multiSeriesUniform"; type: "bool" } + Property { name: "barThickness"; type: "float" } + Property { name: "barSpacing"; type: "QSizeF" } + Property { name: "barSpacingRelative"; type: "bool" } + Property { name: "seriesList"; type: "QBar3DSeries"; isList: true; isReadonly: true } + Property { name: "selectedSeries"; type: "QBar3DSeries"; isReadonly: true; isPointer: true } + Property { name: "primarySeries"; type: "QBar3DSeries"; isPointer: true } + Signal { + name: "rowAxisChanged" + Parameter { name: "axis"; type: "QCategory3DAxis"; isPointer: true } + } + Signal { + name: "valueAxisChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "columnAxisChanged" + Parameter { name: "axis"; type: "QCategory3DAxis"; isPointer: true } + } + Signal { + name: "multiSeriesUniformChanged" + Parameter { name: "uniform"; type: "bool" } + } + Signal { + name: "barThicknessChanged" + Parameter { name: "thicknessRatio"; type: "float" } + } + Signal { + name: "barSpacingChanged" + Parameter { name: "spacing"; type: "QSizeF" } + } + Signal { + name: "barSpacingRelativeChanged" + Parameter { name: "relative"; type: "bool" } + } + Signal { + name: "meshFileNameChanged" + Parameter { name: "filename"; type: "string" } + } + Signal { + name: "primarySeriesChanged" + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + Signal { + name: "selectedSeriesChanged" + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + Method { + name: "handleAxisXChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisYChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisZChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "addSeries" + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + Method { + name: "removeSeries" + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + Method { + name: "insertSeries" + Parameter { name: "index"; type: "int" } + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::DeclarativeColor" + prototype: "QObject" + exports: ["QtDataVisualization/ThemeColor 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "color"; type: "QColor" } + Signal { + name: "colorChanged" + Parameter { name: "color"; type: "QColor" } + } + } + Component { + name: "QtDataVisualization::DeclarativeScatter" + defaultProperty: "seriesList" + prototype: "QtDataVisualization::AbstractDeclarative" + exports: ["QtDataVisualization/Scatter3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "axisX"; type: "QValue3DAxis"; isPointer: true } + Property { name: "axisY"; type: "QValue3DAxis"; isPointer: true } + Property { name: "axisZ"; type: "QValue3DAxis"; isPointer: true } + Property { name: "selectedSeries"; type: "QScatter3DSeries"; isReadonly: true; isPointer: true } + Property { name: "seriesList"; type: "QScatter3DSeries"; isList: true; isReadonly: true } + Signal { + name: "axisXChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "axisYChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "axisZChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "selectedSeriesChanged" + Parameter { name: "series"; type: "QScatter3DSeries"; isPointer: true } + } + Method { + name: "handleAxisXChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisYChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisZChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "addSeries" + Parameter { name: "series"; type: "QScatter3DSeries"; isPointer: true } + } + Method { + name: "removeSeries" + Parameter { name: "series"; type: "QScatter3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::DeclarativeScatter3DSeries" + defaultProperty: "seriesChildren" + prototype: "QtDataVisualization::QScatter3DSeries" + exports: ["QtDataVisualization/Scatter3DSeries 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "baseGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "singleHighlightGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "multiHighlightGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "invalidSelectionIndex"; type: "int"; isReadonly: true } + Signal { + name: "baseGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Method { name: "handleBaseGradientUpdate" } + Method { name: "handleSingleHighlightGradientUpdate" } + Method { name: "handleMultiHighlightGradientUpdate" } + } + Component { + name: "QtDataVisualization::DeclarativeSurface" + defaultProperty: "seriesList" + prototype: "QtDataVisualization::AbstractDeclarative" + exports: ["QtDataVisualization/Surface3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "axisX"; type: "QValue3DAxis"; isPointer: true } + Property { name: "axisY"; type: "QValue3DAxis"; isPointer: true } + Property { name: "axisZ"; type: "QValue3DAxis"; isPointer: true } + Property { name: "selectedSeries"; type: "QSurface3DSeries"; isReadonly: true; isPointer: true } + Property { name: "seriesList"; type: "QSurface3DSeries"; isList: true; isReadonly: true } + Signal { + name: "axisXChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "axisYChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "axisZChanged" + Parameter { name: "axis"; type: "QValue3DAxis"; isPointer: true } + } + Signal { + name: "selectedSeriesChanged" + Parameter { name: "series"; type: "QSurface3DSeries"; isPointer: true } + } + Method { + name: "handleAxisXChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisYChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "handleAxisZChanged" + Parameter { name: "axis"; type: "QAbstract3DAxis"; isPointer: true } + } + Method { + name: "addSeries" + Parameter { name: "series"; type: "QSurface3DSeries"; isPointer: true } + } + Method { + name: "removeSeries" + Parameter { name: "series"; type: "QSurface3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::DeclarativeSurface3DSeries" + defaultProperty: "seriesChildren" + prototype: "QtDataVisualization::QSurface3DSeries" + exports: ["QtDataVisualization/Surface3DSeries 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "selectedPoint"; type: "QPointF" } + Property { name: "invalidSelectionPosition"; type: "QPointF"; isReadonly: true } + Property { name: "baseGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "singleHighlightGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "multiHighlightGradient"; type: "ColorGradient"; isPointer: true } + Signal { + name: "selectedPointChanged" + Parameter { name: "position"; type: "QPointF" } + } + Signal { + name: "baseGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Method { name: "handleBaseGradientUpdate" } + Method { name: "handleSingleHighlightGradientUpdate" } + Method { name: "handleMultiHighlightGradientUpdate" } + } + Component { + name: "QtDataVisualization::DeclarativeTheme3D" + defaultProperty: "seriesChildren" + prototype: "QtDataVisualization::Q3DTheme" + exports: ["QtDataVisualization/Theme3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "baseColors"; type: "DeclarativeColor"; isList: true; isReadonly: true } + Property { name: "baseGradients"; type: "ColorGradient"; isList: true; isReadonly: true } + Property { name: "singleHighlightGradient"; type: "ColorGradient"; isPointer: true } + Property { name: "multiHighlightGradient"; type: "ColorGradient"; isPointer: true } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "ColorGradient"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::Q3DCamera" + prototype: "QtDataVisualization::Q3DObject" + exports: ["QtDataVisualization/Camera3D 1.0"] + exportMetaObjectRevisions: [0] + Enum { + name: "CameraPreset" + values: { + "CameraPresetNone": -1, + "CameraPresetFrontLow": 0, + "CameraPresetFront": 1, + "CameraPresetFrontHigh": 2, + "CameraPresetLeftLow": 3, + "CameraPresetLeft": 4, + "CameraPresetLeftHigh": 5, + "CameraPresetRightLow": 6, + "CameraPresetRight": 7, + "CameraPresetRightHigh": 8, + "CameraPresetBehindLow": 9, + "CameraPresetBehind": 10, + "CameraPresetBehindHigh": 11, + "CameraPresetIsometricLeft": 12, + "CameraPresetIsometricLeftHigh": 13, + "CameraPresetIsometricRight": 14, + "CameraPresetIsometricRightHigh": 15, + "CameraPresetDirectlyAbove": 16, + "CameraPresetDirectlyAboveCW45": 17, + "CameraPresetDirectlyAboveCCW45": 18, + "CameraPresetFrontBelow": 19, + "CameraPresetLeftBelow": 20, + "CameraPresetRightBelow": 21, + "CameraPresetBehindBelow": 22, + "CameraPresetDirectlyBelow": 23 + } + } + Property { name: "xRotation"; type: "float" } + Property { name: "yRotation"; type: "float" } + Property { name: "zoomLevel"; type: "int" } + Property { name: "cameraPreset"; type: "CameraPreset" } + Property { name: "wrapXRotation"; type: "bool" } + Property { name: "wrapYRotation"; type: "bool" } + Signal { + name: "xRotationChanged" + Parameter { name: "rotation"; type: "float" } + } + Signal { + name: "yRotationChanged" + Parameter { name: "rotation"; type: "float" } + } + Signal { + name: "zoomLevelChanged" + Parameter { name: "zoomLevel"; type: "int" } + } + Signal { + name: "cameraPresetChanged" + Parameter { name: "preset"; type: "CameraPreset" } + } + Signal { + name: "wrapXRotationChanged" + Parameter { name: "isEnabled"; type: "bool" } + } + Signal { + name: "wrapYRotationChanged" + Parameter { name: "isEnabled"; type: "bool" } + } + } + Component { + name: "QtDataVisualization::Q3DInputHandler" + prototype: "QtDataVisualization::QAbstract3DInputHandler" + } + Component { + name: "QtDataVisualization::Q3DLight" + prototype: "QtDataVisualization::Q3DObject" + exports: ["QtDataVisualization/Light3D 1.0"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QtDataVisualization::Q3DObject" + prototype: "QObject" + Property { name: "parentScene"; type: "Q3DScene"; isReadonly: true; isPointer: true } + Property { name: "position"; type: "QVector3D" } + Signal { + name: "positionChanged" + Parameter { name: "position"; type: "QVector3D" } + } + } + Component { + name: "QtDataVisualization::Q3DScene" + prototype: "QObject" + Property { name: "viewport"; type: "QRect"; isReadonly: true } + Property { name: "primarySubViewport"; type: "QRect" } + Property { name: "secondarySubViewport"; type: "QRect" } + Property { name: "selectionQueryPosition"; type: "QPoint" } + Property { name: "secondarySubviewOnTop"; type: "bool" } + Property { name: "slicingActive"; type: "bool" } + Property { name: "activeCamera"; type: "Q3DCamera"; isPointer: true } + Property { name: "activeLight"; type: "Q3DLight"; isPointer: true } + Property { name: "devicePixelRatio"; type: "float" } + Signal { + name: "viewportChanged" + Parameter { name: "viewport"; type: "QRect" } + } + Signal { + name: "primarySubViewportChanged" + Parameter { name: "subViewport"; type: "QRect" } + } + Signal { + name: "secondarySubViewportChanged" + Parameter { name: "subViewport"; type: "QRect" } + } + Signal { + name: "secondarySubviewOnTopChanged" + Parameter { name: "isSecondaryOnTop"; type: "bool" } + } + Signal { + name: "slicingActiveChanged" + Parameter { name: "isSlicingActive"; type: "bool" } + } + Signal { + name: "activeCameraChanged" + Parameter { name: "camera"; type: "Q3DCamera"; isPointer: true } + } + Signal { + name: "activeLightChanged" + Parameter { name: "light"; type: "Q3DLight"; isPointer: true } + } + Signal { + name: "devicePixelRatioChanged" + Parameter { name: "pixelRatio"; type: "float" } + } + Signal { + name: "selectionQueryPositionChanged" + Parameter { name: "position"; type: "QPoint" } + } + } + Component { + name: "QtDataVisualization::Q3DTheme" + prototype: "QObject" + exports: ["QtDataVisualization/Q3DTheme 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "ColorStyle" + values: { + "ColorStyleUniform": 0, + "ColorStyleObjectGradient": 1, + "ColorStyleRangeGradient": 2 + } + } + Enum { + name: "Theme" + values: { + "ThemeQt": 0, + "ThemePrimaryColors": 1, + "ThemeDigia": 2, + "ThemeStoneMoss": 3, + "ThemeArmyBlue": 4, + "ThemeRetro": 5, + "ThemeEbony": 6, + "ThemeIsabelle": 7, + "ThemeUserDefined": 8 + } + } + Property { name: "type"; type: "Theme" } + Property { name: "baseColors"; type: "QList" } + Property { name: "backgroundColor"; type: "QColor" } + Property { name: "windowColor"; type: "QColor" } + Property { name: "labelTextColor"; type: "QColor" } + Property { name: "labelBackgroundColor"; type: "QColor" } + Property { name: "gridLineColor"; type: "QColor" } + Property { name: "singleHighlightColor"; type: "QColor" } + Property { name: "multiHighlightColor"; type: "QColor" } + Property { name: "lightColor"; type: "QColor" } + Property { name: "baseGradients"; type: "QList" } + Property { name: "singleHighlightGradient"; type: "QLinearGradient" } + Property { name: "multiHighlightGradient"; type: "QLinearGradient" } + Property { name: "lightStrength"; type: "float" } + Property { name: "ambientLightStrength"; type: "float" } + Property { name: "highlightLightStrength"; type: "float" } + Property { name: "labelBorderEnabled"; type: "bool" } + Property { name: "font"; type: "QFont" } + Property { name: "backgroundEnabled"; type: "bool" } + Property { name: "gridEnabled"; type: "bool" } + Property { name: "labelBackgroundEnabled"; type: "bool" } + Property { name: "colorStyle"; type: "ColorStyle" } + Signal { + name: "typeChanged" + Parameter { name: "themeType"; type: "Theme" } + } + Signal { + name: "baseColorsChanged" + Parameter { name: "colors"; type: "QList" } + } + Signal { + name: "backgroundColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "windowColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "labelTextColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "labelBackgroundColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "gridLineColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "singleHighlightColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "multiHighlightColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "lightColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "baseGradientsChanged" + Parameter { name: "gradients"; type: "QList" } + } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "QLinearGradient" } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "QLinearGradient" } + } + Signal { + name: "lightStrengthChanged" + Parameter { name: "strength"; type: "float" } + } + Signal { + name: "ambientLightStrengthChanged" + Parameter { name: "strength"; type: "float" } + } + Signal { + name: "highlightLightStrengthChanged" + Parameter { name: "strength"; type: "float" } + } + Signal { + name: "labelBorderEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "backgroundEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "gridEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "labelBackgroundEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "colorStyleChanged" + Parameter { name: "style"; type: "ColorStyle" } + } + } + Component { + name: "QtDataVisualization::QAbstract3DAxis" + prototype: "QObject" + exports: ["QtDataVisualization/AbstractAxis3D 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "AxisOrientation" + values: { + "AxisOrientationNone": 0, + "AxisOrientationX": 1, + "AxisOrientationY": 2, + "AxisOrientationZ": 4 + } + } + Enum { + name: "AxisType" + values: { + "AxisTypeNone": 0, + "AxisTypeCategory": 1, + "AxisTypeValue": 2 + } + } + Property { name: "title"; type: "string" } + Property { name: "labels"; type: "QStringList" } + Property { name: "orientation"; type: "AxisOrientation"; isReadonly: true } + Property { name: "type"; type: "AxisType"; isReadonly: true } + Property { name: "min"; type: "float" } + Property { name: "max"; type: "float" } + Property { name: "autoAdjustRange"; type: "bool" } + Signal { + name: "titleChanged" + Parameter { name: "newTitle"; type: "string" } + } + Signal { + name: "orientationChanged" + Parameter { name: "orientation"; type: "AxisOrientation" } + } + Signal { + name: "minChanged" + Parameter { name: "value"; type: "float" } + } + Signal { + name: "maxChanged" + Parameter { name: "value"; type: "float" } + } + Signal { + name: "rangeChanged" + Parameter { name: "min"; type: "float" } + Parameter { name: "max"; type: "float" } + } + Signal { + name: "autoAdjustRangeChanged" + Parameter { name: "autoAdjust"; type: "bool" } + } + } + Component { + name: "QtDataVisualization::QAbstract3DInputHandler" + prototype: "QObject" + exports: ["QtDataVisualization/AbstractInputHandler3D 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "InputView" + values: { + "InputViewNone": 0, + "InputViewOnPrimary": 1, + "InputViewOnSecondary": 2 + } + } + Property { name: "inputView"; type: "InputView" } + Property { name: "inputPosition"; type: "QPoint" } + Property { name: "scene"; type: "Q3DScene"; isPointer: true } + Signal { + name: "positionChanged" + Parameter { name: "position"; type: "QPoint" } + } + Signal { + name: "inputViewChanged" + Parameter { name: "view"; type: "InputView" } + } + Signal { + name: "sceneChanged" + Parameter { name: "scene"; type: "Q3DScene"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::QAbstract3DSeries" + prototype: "QObject" + exports: ["QtDataVisualization/Abstract3DSeries 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "SeriesType" + values: { + "SeriesTypeNone": 0, + "SeriesTypeBar": 1, + "SeriesTypeScatter": 2, + "SeriesTypeSurface": 4 + } + } + Enum { + name: "Mesh" + values: { + "MeshUserDefined": 0, + "MeshBar": 1, + "MeshCube": 2, + "MeshPyramid": 3, + "MeshCone": 4, + "MeshCylinder": 5, + "MeshBevelBar": 6, + "MeshBevelCube": 7, + "MeshSphere": 8, + "MeshMinimal": 9, + "MeshArrow": 10, + "MeshPoint": 11 + } + } + Property { name: "type"; type: "SeriesType"; isReadonly: true } + Property { name: "itemLabelFormat"; type: "string" } + Property { name: "visible"; type: "bool" } + Property { name: "mesh"; type: "Mesh" } + Property { name: "meshSmooth"; type: "bool" } + Property { name: "meshRotation"; type: "QQuaternion" } + Property { name: "userDefinedMesh"; type: "string" } + Property { name: "colorStyle"; type: "QtDataVisualization::Q3DTheme::ColorStyle" } + Property { name: "baseColor"; type: "QColor" } + Property { name: "baseGradient"; type: "QLinearGradient" } + Property { name: "singleHighlightColor"; type: "QColor" } + Property { name: "singleHighlightGradient"; type: "QLinearGradient" } + Property { name: "multiHighlightColor"; type: "QColor" } + Property { name: "multiHighlightGradient"; type: "QLinearGradient" } + Property { name: "name"; type: "string" } + Signal { + name: "itemLabelFormatChanged" + Parameter { name: "format"; type: "string" } + } + Signal { + name: "visibilityChanged" + Parameter { name: "visible"; type: "bool" } + } + Signal { + name: "meshChanged" + Parameter { name: "mesh"; type: "Mesh" } + } + Signal { + name: "meshSmoothChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "meshRotationChanged" + Parameter { name: "rotation"; type: "QQuaternion" } + } + Signal { + name: "userDefinedMeshChanged" + Parameter { name: "fileName"; type: "string" } + } + Signal { + name: "colorStyleChanged" + Parameter { name: "style"; type: "Q3DTheme::ColorStyle" } + } + Signal { + name: "baseColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "baseGradientChanged" + Parameter { name: "gradient"; type: "QLinearGradient" } + } + Signal { + name: "singleHighlightColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "singleHighlightGradientChanged" + Parameter { name: "gradient"; type: "QLinearGradient" } + } + Signal { + name: "multiHighlightColorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "multiHighlightGradientChanged" + Parameter { name: "gradient"; type: "QLinearGradient" } + } + Signal { + name: "nameChanged" + Parameter { name: "name"; type: "string" } + } + Method { + name: "setMeshAxisAndAngle" + Parameter { name: "axis"; type: "QVector3D" } + Parameter { name: "angle"; type: "float" } + } + } + Component { + name: "QtDataVisualization::QAbstractDataProxy" + prototype: "QObject" + exports: ["QtDataVisualization/AbstractDataProxy 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "DataType" + values: { + "DataTypeNone": 0, + "DataTypeBar": 1, + "DataTypeScatter": 2, + "DataTypeSurface": 4 + } + } + Property { name: "type"; type: "DataType"; isReadonly: true } + } + Component { + name: "QtDataVisualization::QBar3DSeries" + prototype: "QtDataVisualization::QAbstract3DSeries" + exports: ["QtDataVisualization/QBar3DSeries 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "dataProxy"; type: "QBarDataProxy"; isPointer: true } + Property { name: "selectedBar"; type: "QPoint" } + Property { name: "meshAngle"; type: "float" } + Signal { + name: "dataProxyChanged" + Parameter { name: "proxy"; type: "QBarDataProxy"; isPointer: true } + } + Signal { + name: "selectedBarChanged" + Parameter { name: "position"; type: "QPoint" } + } + Signal { + name: "meshAngleChanged" + Parameter { name: "angle"; type: "float" } + } + } + Component { + name: "QtDataVisualization::QBarDataProxy" + prototype: "QtDataVisualization::QAbstractDataProxy" + exports: ["QtDataVisualization/BarDataProxy 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "rowCount"; type: "int"; isReadonly: true } + Property { name: "rowLabels"; type: "QStringList" } + Property { name: "columnLabels"; type: "QStringList" } + Property { name: "series"; type: "QBar3DSeries"; isReadonly: true; isPointer: true } + Signal { name: "arrayReset" } + Signal { + name: "rowsAdded" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsChanged" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsRemoved" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsInserted" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemChanged" + Parameter { name: "rowIndex"; type: "int" } + Parameter { name: "columnIndex"; type: "int" } + } + Signal { + name: "rowCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "seriesChanged" + Parameter { name: "series"; type: "QBar3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::QCategory3DAxis" + prototype: "QtDataVisualization::QAbstract3DAxis" + exports: ["QtDataVisualization/CategoryAxis3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "labels"; type: "QStringList" } + } + Component { + name: "QtDataVisualization::QHeightMapSurfaceDataProxy" + prototype: "QtDataVisualization::QSurfaceDataProxy" + exports: ["QtDataVisualization/HeightMapSurfaceDataProxy 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "heightMap"; type: "QImage" } + Property { name: "heightMapFile"; type: "string" } + Property { name: "minXValue"; type: "float" } + Property { name: "maxXValue"; type: "float" } + Property { name: "minZValue"; type: "float" } + Property { name: "maxZValue"; type: "float" } + Signal { + name: "heightMapChanged" + Parameter { name: "image"; type: "QImage" } + } + Signal { + name: "heightMapFileChanged" + Parameter { name: "filename"; type: "string" } + } + Signal { + name: "minXValueChanged" + Parameter { name: "value"; type: "float" } + } + Signal { + name: "maxXValueChanged" + Parameter { name: "value"; type: "float" } + } + Signal { + name: "minZValueChanged" + Parameter { name: "value"; type: "float" } + } + Signal { + name: "maxZValueChanged" + Parameter { name: "value"; type: "float" } + } + } + Component { + name: "QtDataVisualization::QItemModelBarDataProxy" + prototype: "QtDataVisualization::QBarDataProxy" + exports: ["QtDataVisualization/ItemModelBarDataProxy 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + Property { name: "rowRole"; type: "string" } + Property { name: "columnRole"; type: "string" } + Property { name: "valueRole"; type: "string" } + Property { name: "rotationRole"; type: "string" } + Property { name: "rowCategories"; type: "QStringList" } + Property { name: "columnCategories"; type: "QStringList" } + Property { name: "useModelCategories"; type: "bool" } + Property { name: "autoRowCategories"; type: "bool" } + Property { name: "autoColumnCategories"; type: "bool" } + Signal { + name: "itemModelChanged" + Parameter { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + } + Signal { + name: "rowRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "columnRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "valueRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "rotationRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "useModelCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "autoRowCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "autoColumnCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Method { + name: "rowCategoryIndex" + type: "int" + Parameter { name: "category"; type: "string" } + } + Method { + name: "columnCategoryIndex" + type: "int" + Parameter { name: "category"; type: "string" } + } + } + Component { + name: "QtDataVisualization::QItemModelScatterDataProxy" + prototype: "QtDataVisualization::QScatterDataProxy" + exports: ["QtDataVisualization/ItemModelScatterDataProxy 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + Property { name: "xPosRole"; type: "string" } + Property { name: "yPosRole"; type: "string" } + Property { name: "zPosRole"; type: "string" } + Property { name: "rotationRole"; type: "string" } + Signal { + name: "itemModelChanged" + Parameter { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + } + Signal { + name: "xPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "yPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "zPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "rotationRoleChanged" + Parameter { name: "role"; type: "string" } + } + } + Component { + name: "QtDataVisualization::QItemModelSurfaceDataProxy" + prototype: "QtDataVisualization::QSurfaceDataProxy" + exports: ["QtDataVisualization/ItemModelSurfaceDataProxy 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + Property { name: "rowRole"; type: "string" } + Property { name: "columnRole"; type: "string" } + Property { name: "xPosRole"; type: "string" } + Property { name: "yPosRole"; type: "string" } + Property { name: "zPosRole"; type: "string" } + Property { name: "rowCategories"; type: "QStringList" } + Property { name: "columnCategories"; type: "QStringList" } + Property { name: "useModelCategories"; type: "bool" } + Property { name: "autoRowCategories"; type: "bool" } + Property { name: "autoColumnCategories"; type: "bool" } + Signal { + name: "itemModelChanged" + Parameter { name: "itemModel"; type: "const QAbstractItemModel"; isPointer: true } + } + Signal { + name: "rowRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "columnRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "xPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "yPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "zPosRoleChanged" + Parameter { name: "role"; type: "string" } + } + Signal { + name: "useModelCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "autoRowCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "autoColumnCategoriesChanged" + Parameter { name: "enable"; type: "bool" } + } + Method { + name: "rowCategoryIndex" + type: "int" + Parameter { name: "category"; type: "string" } + } + Method { + name: "columnCategoryIndex" + type: "int" + Parameter { name: "category"; type: "string" } + } + } + Component { + name: "QtDataVisualization::QScatter3DSeries" + prototype: "QtDataVisualization::QAbstract3DSeries" + exports: ["QtDataVisualization/QScatter3DSeries 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "dataProxy"; type: "QScatterDataProxy"; isPointer: true } + Property { name: "selectedItem"; type: "int" } + Property { name: "itemSize"; type: "float" } + Signal { + name: "dataProxyChanged" + Parameter { name: "proxy"; type: "QScatterDataProxy"; isPointer: true } + } + Signal { + name: "selectedItemChanged" + Parameter { name: "index"; type: "int" } + } + Signal { + name: "itemSizeChanged" + Parameter { name: "size"; type: "float" } + } + } + Component { + name: "QtDataVisualization::QScatterDataProxy" + prototype: "QtDataVisualization::QAbstractDataProxy" + exports: ["QtDataVisualization/ScatterDataProxy 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "itemCount"; type: "int"; isReadonly: true } + Property { name: "series"; type: "QScatter3DSeries"; isReadonly: true; isPointer: true } + Signal { name: "arrayReset" } + Signal { + name: "itemsAdded" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemsChanged" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemsRemoved" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemsInserted" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "seriesChanged" + Parameter { name: "series"; type: "QScatter3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::QSurface3DSeries" + prototype: "QtDataVisualization::QAbstract3DSeries" + exports: ["QtDataVisualization/QSurface3DSeries 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "DrawFlag" + values: { + "DrawWireframe": 1, + "DrawSurface": 2, + "DrawSurfaceAndWireframe": 3 + } + } + Enum { + name: "DrawFlags" + values: { + "DrawWireframe": 1, + "DrawSurface": 2, + "DrawSurfaceAndWireframe": 3 + } + } + Property { name: "dataProxy"; type: "QSurfaceDataProxy"; isPointer: true } + Property { name: "selectedPoint"; type: "QPoint" } + Property { name: "flatShadingEnabled"; type: "bool" } + Property { name: "flatShadingSupported"; type: "bool"; isReadonly: true } + Property { name: "drawMode"; type: "DrawFlags" } + Signal { + name: "dataProxyChanged" + Parameter { name: "proxy"; type: "QSurfaceDataProxy"; isPointer: true } + } + Signal { + name: "selectedPointChanged" + Parameter { name: "position"; type: "QPoint" } + } + Signal { + name: "flatShadingEnabledChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "flatShadingSupportedChanged" + Parameter { name: "enable"; type: "bool" } + } + Signal { + name: "drawModeChanged" + Parameter { name: "mode"; type: "QSurface3DSeries::DrawFlags" } + } + } + Component { + name: "QtDataVisualization::QSurfaceDataProxy" + prototype: "QtDataVisualization::QAbstractDataProxy" + exports: ["QtDataVisualization/SurfaceDataProxy 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "rowCount"; type: "int"; isReadonly: true } + Property { name: "columnCount"; type: "int"; isReadonly: true } + Property { name: "series"; type: "QSurface3DSeries"; isReadonly: true; isPointer: true } + Signal { name: "arrayReset" } + Signal { + name: "rowsAdded" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsChanged" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsRemoved" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "rowsInserted" + Parameter { name: "startIndex"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Signal { + name: "itemChanged" + Parameter { name: "rowIndex"; type: "int" } + Parameter { name: "columnIndex"; type: "int" } + } + Signal { + name: "rowCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "columnCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "seriesChanged" + Parameter { name: "series"; type: "QSurface3DSeries"; isPointer: true } + } + } + Component { + name: "QtDataVisualization::QTouch3DInputHandler" + prototype: "QtDataVisualization::Q3DInputHandler" + } + Component { + name: "QtDataVisualization::QValue3DAxis" + prototype: "QtDataVisualization::QAbstract3DAxis" + exports: ["QtDataVisualization/ValueAxis3D 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "segmentCount"; type: "int" } + Property { name: "subSegmentCount"; type: "int" } + Property { name: "labelFormat"; type: "string" } + Signal { + name: "segmentCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "subSegmentCountChanged" + Parameter { name: "count"; type: "int" } + } + Signal { + name: "labelFormatChanged" + Parameter { name: "format"; type: "string" } + } + } +} -- cgit v1.2.3 From 1820e7b7f4baaeebd1b357375476bfa68ec2589e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 10:49:23 +0100 Subject: Changing float to double MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QmlDesigner has a problem handling "float". This will be fixed, but as a workaround we just change float to double. The code model does not differentiate between float and double. Change-Id: If5802efdb501c24194cd758e0a10612c2c5e630b Reviewed-by: Miikka Heikkinen Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/plugins.qmltypes | 66 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/datavisualizationqml2/plugins.qmltypes b/src/datavisualizationqml2/plugins.qmltypes index 7831ab43..48a30665 100644 --- a/src/datavisualizationqml2/plugins.qmltypes +++ b/src/datavisualizationqml2/plugins.qmltypes @@ -197,7 +197,7 @@ Module { Property { name: "valueAxis"; type: "QValue3DAxis"; isPointer: true } Property { name: "columnAxis"; type: "QCategory3DAxis"; isPointer: true } Property { name: "multiSeriesUniform"; type: "bool" } - Property { name: "barThickness"; type: "float" } + Property { name: "barThickness"; type: "double" } Property { name: "barSpacing"; type: "QSizeF" } Property { name: "barSpacingRelative"; type: "bool" } Property { name: "seriesList"; type: "QBar3DSeries"; isList: true; isReadonly: true } @@ -221,7 +221,7 @@ Module { } Signal { name: "barThicknessChanged" - Parameter { name: "thicknessRatio"; type: "float" } + Parameter { name: "thicknessRatio"; type: "double" } } Signal { name: "barSpacingChanged" @@ -490,19 +490,19 @@ Module { "CameraPresetDirectlyBelow": 23 } } - Property { name: "xRotation"; type: "float" } - Property { name: "yRotation"; type: "float" } + Property { name: "xRotation"; type: "double" } + Property { name: "yRotation"; type: "double" } Property { name: "zoomLevel"; type: "int" } Property { name: "cameraPreset"; type: "CameraPreset" } Property { name: "wrapXRotation"; type: "bool" } Property { name: "wrapYRotation"; type: "bool" } Signal { name: "xRotationChanged" - Parameter { name: "rotation"; type: "float" } + Parameter { name: "rotation"; type: "double" } } Signal { name: "yRotationChanged" - Parameter { name: "rotation"; type: "float" } + Parameter { name: "rotation"; type: "double" } } Signal { name: "zoomLevelChanged" @@ -552,7 +552,7 @@ Module { Property { name: "slicingActive"; type: "bool" } Property { name: "activeCamera"; type: "Q3DCamera"; isPointer: true } Property { name: "activeLight"; type: "Q3DLight"; isPointer: true } - Property { name: "devicePixelRatio"; type: "float" } + Property { name: "devicePixelRatio"; type: "double" } Signal { name: "viewportChanged" Parameter { name: "viewport"; type: "QRect" } @@ -583,7 +583,7 @@ Module { } Signal { name: "devicePixelRatioChanged" - Parameter { name: "pixelRatio"; type: "float" } + Parameter { name: "pixelRatio"; type: "double" } } Signal { name: "selectionQueryPositionChanged" @@ -631,9 +631,9 @@ Module { Property { name: "baseGradients"; type: "QList" } Property { name: "singleHighlightGradient"; type: "QLinearGradient" } Property { name: "multiHighlightGradient"; type: "QLinearGradient" } - Property { name: "lightStrength"; type: "float" } - Property { name: "ambientLightStrength"; type: "float" } - Property { name: "highlightLightStrength"; type: "float" } + Property { name: "lightStrength"; type: "double" } + Property { name: "ambientLightStrength"; type: "double" } + Property { name: "highlightLightStrength"; type: "double" } Property { name: "labelBorderEnabled"; type: "bool" } Property { name: "font"; type: "QFont" } Property { name: "backgroundEnabled"; type: "bool" } @@ -694,15 +694,15 @@ Module { } Signal { name: "lightStrengthChanged" - Parameter { name: "strength"; type: "float" } + Parameter { name: "strength"; type: "double" } } Signal { name: "ambientLightStrengthChanged" - Parameter { name: "strength"; type: "float" } + Parameter { name: "strength"; type: "double" } } Signal { name: "highlightLightStrengthChanged" - Parameter { name: "strength"; type: "float" } + Parameter { name: "strength"; type: "double" } } Signal { name: "labelBorderEnabledChanged" @@ -756,8 +756,8 @@ Module { Property { name: "labels"; type: "QStringList" } Property { name: "orientation"; type: "AxisOrientation"; isReadonly: true } Property { name: "type"; type: "AxisType"; isReadonly: true } - Property { name: "min"; type: "float" } - Property { name: "max"; type: "float" } + Property { name: "min"; type: "double" } + Property { name: "max"; type: "double" } Property { name: "autoAdjustRange"; type: "bool" } Signal { name: "titleChanged" @@ -769,16 +769,16 @@ Module { } Signal { name: "minChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } Signal { name: "maxChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } Signal { name: "rangeChanged" - Parameter { name: "min"; type: "float" } - Parameter { name: "max"; type: "float" } + Parameter { name: "min"; type: "double" } + Parameter { name: "max"; type: "double" } } Signal { name: "autoAdjustRangeChanged" @@ -921,7 +921,7 @@ Module { Method { name: "setMeshAxisAndAngle" Parameter { name: "axis"; type: "QVector3D" } - Parameter { name: "angle"; type: "float" } + Parameter { name: "angle"; type: "double" } } } Component { @@ -949,7 +949,7 @@ Module { exportMetaObjectRevisions: [0] Property { name: "dataProxy"; type: "QBarDataProxy"; isPointer: true } Property { name: "selectedBar"; type: "QPoint" } - Property { name: "meshAngle"; type: "float" } + Property { name: "meshAngle"; type: "double" } Signal { name: "dataProxyChanged" Parameter { name: "proxy"; type: "QBarDataProxy"; isPointer: true } @@ -960,7 +960,7 @@ Module { } Signal { name: "meshAngleChanged" - Parameter { name: "angle"; type: "float" } + Parameter { name: "angle"; type: "double" } } } Component { @@ -1022,10 +1022,10 @@ Module { exportMetaObjectRevisions: [0] Property { name: "heightMap"; type: "QImage" } Property { name: "heightMapFile"; type: "string" } - Property { name: "minXValue"; type: "float" } - Property { name: "maxXValue"; type: "float" } - Property { name: "minZValue"; type: "float" } - Property { name: "maxZValue"; type: "float" } + Property { name: "minXValue"; type: "double" } + Property { name: "maxXValue"; type: "double" } + Property { name: "minZValue"; type: "double" } + Property { name: "maxZValue"; type: "double" } Signal { name: "heightMapChanged" Parameter { name: "image"; type: "QImage" } @@ -1036,19 +1036,19 @@ Module { } Signal { name: "minXValueChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } Signal { name: "maxXValueChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } Signal { name: "minZValueChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } Signal { name: "maxZValueChanged" - Parameter { name: "value"; type: "float" } + Parameter { name: "value"; type: "double" } } } Component { @@ -1211,7 +1211,7 @@ Module { exportMetaObjectRevisions: [0] Property { name: "dataProxy"; type: "QScatterDataProxy"; isPointer: true } Property { name: "selectedItem"; type: "int" } - Property { name: "itemSize"; type: "float" } + Property { name: "itemSize"; type: "double" } Signal { name: "dataProxyChanged" Parameter { name: "proxy"; type: "QScatterDataProxy"; isPointer: true } @@ -1222,7 +1222,7 @@ Module { } Signal { name: "itemSizeChanged" - Parameter { name: "size"; type: "float" } + Parameter { name: "size"; type: "double" } } } Component { -- cgit v1.2.3 From 7b2d3a7770481dababd7d548f60932c212e10986 Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Wed, 5 Mar 2014 12:47:02 +0200 Subject: Remove obsolete property documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ice8ea6f8ce26cdd77d52c71d9e6b14c91e52c57c Reviewed-by: Tomi Korpipää --- src/datavisualization/data/qsurface3dseries.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/datavisualization/data/qsurface3dseries.cpp b/src/datavisualization/data/qsurface3dseries.cpp index c5ac9fe8..72967bae 100644 --- a/src/datavisualization/data/qsurface3dseries.cpp +++ b/src/datavisualization/data/qsurface3dseries.cpp @@ -124,12 +124,6 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The value of flatShadingSupported property indicates if flat shading is supported at runtime. */ -/*! - * \qmlproperty bool Surface3DSeries::surfaceGridEnabled - * - * Sets surface grid to \a enabled. It is preset to \c true by default. - */ - /*! * \qmlproperty bool Surface3DSeries::flatShadingSupported * -- cgit v1.2.3 From 40ce5faf49631d0b65c1c3d4de61215003ec72c1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 13:43:43 +0100 Subject: Fixing the enum scopes for the comboboxes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warning: This does require Qt Creator 5.1, but I think Qt Creator 5.1 should be a requirement. Change-Id: I2783d28618bfdf468cb1ab8ee9d2268894364fa7 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/designer/Bars3DSpecifics.qml | 3 +++ src/datavisualizationqml2/designer/Scatter3DSpecifics.qml | 3 +++ src/datavisualizationqml2/designer/Surface3DSpecifics.qml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index 708e8213..e6b9f83a 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -63,6 +63,7 @@ Column { model: ["RenderIndirect", "RenderDirectToBackground", "RenderDirectToBackground_NoClear"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -89,6 +90,7 @@ Column { "ShadowQualityHigh", "ShadowQualitySoftLow", "ShadowQualitySoftMedium", "ShadowQualitySoftHigh"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -122,6 +124,7 @@ Column { "SelectionItemAndColumn | SelectionSlice | SelectionMultiSeries" ] Layout.fillWidth: true + scope: "AbstractGraph3D" } } } diff --git a/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml b/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml index b7b2f1f5..b9a9ef97 100644 --- a/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Scatter3DSpecifics.qml @@ -41,6 +41,7 @@ Column { model: ["RenderIndirect", "RenderDirectToBackground", "RenderDirectToBackground_NoClear"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -67,6 +68,7 @@ Column { "ShadowQualityHigh", "ShadowQualitySoftLow", "ShadowQualitySoftMedium", "ShadowQualitySoftHigh"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -79,6 +81,7 @@ Column { backendValue: backendValues.selectionMode model: ["SelectionNone", "SelectionItem"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } } diff --git a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml index c6c634b4..7723e7ec 100644 --- a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml @@ -41,6 +41,7 @@ Column { model: ["RenderIndirect", "RenderDirectToBackground", "RenderDirectToBackground_NoClear"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -67,6 +68,7 @@ Column { "ShadowQualityHigh", "ShadowQualitySoftLow", "ShadowQualitySoftMedium", "ShadowQualitySoftHigh"] Layout.fillWidth: true + scope: "AbstractGraph3D" } } Label { @@ -90,6 +92,7 @@ Column { "SelectionItemAndColumn | SelectionSlice | SelectionMultiSeries" ] Layout.fillWidth: true + scope: "AbstractGraph3D" } } } -- cgit v1.2.3 From 3783b9c38c50f4a4431b995bcc80ddd1a8c0c106 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 13:54:58 +0100 Subject: Adding support for barThickness and barSpacing again. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The barSpacing property barSpacing is rounded to integers, but this is fixed by: https://codereview.qt-project.org/#change,79968 Change-Id: I39844ccfa90c4aa344c05bc87d6039fcf3836cb0 Reviewed-by: Tomi Korpipää --- .../designer/Bars3DSpecifics.qml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index e6b9f83a..33fd6f22 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -41,6 +41,46 @@ Column { Layout.fillWidth: true } } + Label { + text: qsTr("barThickness") + toolTip: qsTr("Bar Thickness Ratio") + Layout.fillWidth: true + } + SecondColumnLayout { + SpinBox { + backendValue: backendValues.barThickness + minimumValue: 0.001 + maximumValue: 1.0 + stepSize: 0.001 + decimals: 3 + Layout.fillWidth: true + } + } + Label { + text: qsTr("barSpacing") + toolTip: qsTr("Bar Spacing") + Layout.fillWidth: true + } + SecondColumnLayout { + SpinBox { + prefix: "col: " + backendValue: backendValues.barSpacing_width + minimumValue: 0.0 + maximumValue: 10.0 + stepSize: 0.01 + decimals: 2 + Layout.fillWidth: true + } + SpinBox { + prefix: "row: " + backendValue: backendValues.barSpacing_height + minimumValue: 0.0 + maximumValue: 10.0 + stepSize: 0.01 + decimals: 2 + Layout.fillWidth: true + } + } Label { text: qsTr("barSpacingRelative") toolTip: qsTr("Bar Spacing Relative") -- cgit v1.2.3 From a6f24756212c849bd0ce1de42c054f99da588bab Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Wed, 5 Mar 2014 16:22:43 +0200 Subject: Readability improvement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I77f2b488b44eb1d985bdb6985b979f46bba04085 Reviewed-by: Tomi Korpipää --- src/datavisualization/data/qheightmapsurfacedataproxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datavisualization/data/qheightmapsurfacedataproxy.cpp b/src/datavisualization/data/qheightmapsurfacedataproxy.cpp index b7111afc..56fcf5d1 100644 --- a/src/datavisualization/data/qheightmapsurfacedataproxy.cpp +++ b/src/datavisualization/data/qheightmapsurfacedataproxy.cpp @@ -31,7 +31,7 @@ const float defaultMaxValue = 10.0f; * \since Qt Data Visualization 1.0 * * QHeightMapSurfaceDataProxy takes care of surface related height map data handling. It provides a - * way for giving the surface plot a height map to be visualized. + * way to give a height map to be visualized as a surface plot. * * Since height maps do not contain values for X or Z axes, those values need to be given * separately using minXValue, maxXValue, minZValue, and maxZValue properties. X-value corresponds @@ -51,7 +51,7 @@ const float defaultMaxValue = 10.0f; * \brief Base proxy type for Surface3D. * * HeightMapSurfaceDataProxy takes care of surface related height map data handling. It provides a - * way for giving the surface plot a height map to be visualized. + * way to give a height map to be visualized as a surface plot. * * For more complete description, see QHeightMapSurfaceDataProxy. * -- cgit v1.2.3 From 045cf69f2a35c23b40489240fe0986b766be10cc Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 6 Mar 2014 11:17:04 +0200 Subject: Mention Creator 3.1 need in README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I89dd8467502901299aa5ed3dc66b4dda5b6546a1 Reviewed-by: Tomi Korpipää --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 0d9d9971..0f9f25b2 100644 --- a/README +++ b/README @@ -10,6 +10,8 @@ System Requirements - Qt 5.2 or newer - OpenGL 2.1 or newer (recommended) or OpenGL ES2 (reduced feature set) +- Manipulating Qt Data Visualization graphs with QML Designer requires + Qt Creator 3.1 or newer Building ======== -- cgit v1.2.3 From 0c8fd42e4361aa31e16322911eb90478fb7dfa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 6 Mar 2014 12:33:19 +0200 Subject: barThickness tweak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7180b0348ee2e006f3e9727f8686cf7628e6df48 Change-Id: I7180b0348ee2e006f3e9727f8686cf7628e6df48 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/designer/Bars3DSpecifics.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index 33fd6f22..55b06d97 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -49,10 +49,10 @@ Column { SecondColumnLayout { SpinBox { backendValue: backendValues.barThickness - minimumValue: 0.001 - maximumValue: 1.0 - stepSize: 0.001 - decimals: 3 + minimumValue: 0.01 + maximumValue: 100.0 + stepSize: 0.01 + decimals: 2 Layout.fillWidth: true } } -- cgit v1.2.3 From fdf73a5f8831b6a8198965b7bd009077fdac5403 Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Thu, 6 Mar 2014 13:34:04 +0200 Subject: ItemModelBarDataProxy property type fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0f4f62bdb89067ac142164afb66dbfc481e72bc2 Reviewed-by: Tomi Korpipää --- src/datavisualization/data/qitemmodelbardataproxy.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/datavisualization/data/qitemmodelbardataproxy.cpp b/src/datavisualization/data/qitemmodelbardataproxy.cpp index 4d220b13..2281e33f 100644 --- a/src/datavisualization/data/qitemmodelbardataproxy.cpp +++ b/src/datavisualization/data/qitemmodelbardataproxy.cpp @@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelBarDataProxy::itemModel + * \qmlproperty model ItemModelBarDataProxy::itemModel * The item model. */ @@ -110,33 +110,33 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelBarDataProxy::rowCategories + * \qmlproperty list ItemModelBarDataProxy::rowCategories * The row categories of the mapping. Only items with row roles that are found in this list are * included when the data is resolved. The rows are ordered in the same order as they are in this list. */ /*! - * \qmlproperty list ItemModelBarDataProxy::columnCategories + * \qmlproperty list ItemModelBarDataProxy::columnCategories * The column categories of the mapping. Only items with column roles that are found in this list are * included when the data is resolved. The columns are ordered in the same order as they are in this list. */ /*! - * \qmlproperty list ItemModelBarDataProxy::useModelCategories + * \qmlproperty bool ItemModelBarDataProxy::useModelCategories * When set to true, the mapping ignores row and column roles and categories, and uses * the rows and columns from the model instead. Row and column headers are used for row and column * labels. Defaults to \c{false}. */ /*! - * \qmlproperty list ItemModelBarDataProxy::autoRowCategories + * \qmlproperty bool ItemModelBarDataProxy::autoRowCategories * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the * data from the model is resolved. Defaults to \c{true}. */ /*! - * \qmlproperty list ItemModelBarDataProxy::autoColumnCategories + * \qmlproperty bool ItemModelBarDataProxy::autoColumnCategories * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the * data from model is resolved. Defaults to \c{true}. -- cgit v1.2.3 From 0655c246c344a587cd7ee013ccf57da8f2cc6502 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 7 Mar 2014 09:38:02 +0200 Subject: Fix examples docs for creator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I847d6f506559f0935ea9703ea5fae93a8b3af8d2 Reviewed-by: Tomi Korpipää --- .../doc/qtdatavisualization.qdocconf | 58 +++++++++++----------- .../doc/src/qtdatavisualization.qdoc | 1 + 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/src/datavisualization/doc/qtdatavisualization.qdocconf b/src/datavisualization/doc/qtdatavisualization.qdocconf index 8bf5a012..5c871b5a 100644 --- a/src/datavisualization/doc/qtdatavisualization.qdocconf +++ b/src/datavisualization/doc/qtdatavisualization.qdocconf @@ -16,40 +16,42 @@ imagedirs += ../images \ images sourcedirs += .. +examplesinstallpath = datavisualization + indexes += $QT_INSTALL_DOCS/qtcore/qtcore.index \ $QT_INSTALL_DOCS/qtgui/qtgui.index \ $QT_INSTALL_DOCS/qtqml/qtqml.index \ $QT_INSTALL_DOCS/qtquick/qtquick.index \ $QT_INSTALL_DOCS/qtmultimedia/qtmultimedia.index -qhp.projects = qtdatavisualization - -qhp.qtdatavisualization.file = qtdatavisualization.qhp -qhp.qtdatavisualization.namespace = com.digia.qtdatavisualization.100 -qhp.qtdatavisualization.virtualFolder = qtdatavisualization -qhp.qtdatavisualization.indexTitle = Qt Data Visualization -qhp.qtdatavisualization.indexRoot = - -qhp.qtdatavisualization.filterAttributes = qtdatavisualization 1.0.0 qtrefdoc -qhp.qtdatavisualization.customFilters.Qt.name = QtDataVisualization 1.0.0 -qhp.qtdatavisualization.customFilters.Qt.filterAttributes = qtdatavisualization 1.0.0 -qhp.qtdatavisualization.subprojects = gettingstarted examples classes types -qhp.qtdatavisualization.subprojects.gettingstarted.title = Getting Started -qhp.qtdatavisualization.subprojects.gettingstarted.indexTitle = Qt Data Visualization Getting Started -qhp.qtdatavisualization.subprojects.gettingstarted.selectors = fake:page -qhp.qtdatavisualization.subprojects.gettingstarted.sortPages = true -qhp.qtdatavisualization.subprojects.examples.title = Examples -qhp.qtdatavisualization.subprojects.examples.indexTitle = Qt Data Visualization Examples -qhp.qtdatavisualization.subprojects.examples.selectors = fake:example -qhp.qtdatavisualization.subprojects.examples.sortPages = true -qhp.qtdatavisualization.subprojects.classes.title = C++ Classes -qhp.qtdatavisualization.subprojects.classes.indexTitle = Qt Data Visualization C++ Classes -qhp.qtdatavisualization.subprojects.classes.selectors = class -qhp.qtdatavisualization.subprojects.classes.sortPages = true -qhp.qtdatavisualization.subprojects.types.title = QML Types -qhp.qtdatavisualization.subprojects.types.indexTitle = Qt Data Visualization QML Types -qhp.qtdatavisualization.subprojects.types.selectors = fake:qmlclass -qhp.qtdatavisualization.subprojects.types.sortPages = true +qhp.projects = QtDataVisualization + +qhp.QtDataVisualization.file = qtdatavisualization.qhp +qhp.QtDataVisualization.namespace = com.digia.qtdatavisualization.100 +qhp.QtDataVisualization.virtualFolder = qtdatavisualization +qhp.QtDataVisualization.indexTitle = Qt Data Visualization +qhp.QtDataVisualization.indexRoot = + +qhp.QtDataVisualization.filterAttributes = qtdatavisualization 1.0.0 qtrefdoc +qhp.QtDataVisualization.customFilters.Qt.name = QtDataVisualization 1.0.0 +qhp.QtDataVisualization.customFilters.Qt.filterAttributes = qtdatavisualization 1.0.0 +qhp.QtDataVisualization.subprojects = gettingstarted examples classes types +qhp.QtDataVisualization.subprojects.gettingstarted.title = Getting Started +qhp.QtDataVisualization.subprojects.gettingstarted.indexTitle = Qt Data Visualization Getting Started +qhp.QtDataVisualization.subprojects.gettingstarted.selectors = fake:page +qhp.QtDataVisualization.subprojects.gettingstarted.sortPages = true +qhp.QtDataVisualization.subprojects.examples.title = Examples +qhp.QtDataVisualization.subprojects.examples.indexTitle = Qt Data Visualization Examples +qhp.QtDataVisualization.subprojects.examples.selectors = fake:example +qhp.QtDataVisualization.subprojects.examples.sortPages = true +qhp.QtDataVisualization.subprojects.classes.title = C++ Classes +qhp.QtDataVisualization.subprojects.classes.indexTitle = Qt Data Visualization C++ Classes +qhp.QtDataVisualization.subprojects.classes.selectors = class +qhp.QtDataVisualization.subprojects.classes.sortPages = true +qhp.QtDataVisualization.subprojects.types.title = QML Types +qhp.QtDataVisualization.subprojects.types.indexTitle = Qt Data Visualization QML Types +qhp.QtDataVisualization.subprojects.types.selectors = fake:qmlclass +qhp.QtDataVisualization.subprojects.types.sortPages = true navigation.landingpage = Qt Data Visualization navigation.cppclassespage = Qt Data Visualization C++ Classes diff --git a/src/datavisualization/doc/src/qtdatavisualization.qdoc b/src/datavisualization/doc/src/qtdatavisualization.qdoc index f8d3178d..8d1d1c32 100644 --- a/src/datavisualization/doc/src/qtdatavisualization.qdoc +++ b/src/datavisualization/doc/src/qtdatavisualization.qdoc @@ -50,6 +50,7 @@ /*! \group datavisualization_examples + \ingroup all-examples \title Qt Data Visualization Examples \brief Examples for the Qt Data Visualization. -- cgit v1.2.3 From 509ff19cb502a99db1ba662e98c92397c3714f6a Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Thu, 6 Mar 2014 17:30:53 +0200 Subject: Property type fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I43d9a3b27cf76a8d9b80b102705ab25c7bb7636c Reviewed-by: Tomi Korpipää Reviewed-by: Miikka Heikkinen --- src/datavisualization/data/qitemmodelscatterdataproxy.cpp | 2 +- src/datavisualization/data/qitemmodelsurfacedataproxy.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp index c4924886..16a7b8b5 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp +++ b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelScatterDataProxy::itemModel + * \qmlproperty model ItemModelScatterDataProxy::itemModel * The item model. */ diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp index 01645040..440ce2d6 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp @@ -89,7 +89,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::itemModel + * \qmlproperty model ItemModelSurfaceDataProxy::itemModel * The item model. */ @@ -125,25 +125,25 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::rowCategories + * \qmlproperty list ItemModelSurfaceDataProxy::rowCategories * The row categories of the mapping. Only items with row roles that are found in this list are * included when data is resolved. The rows are ordered in the same order as they are in this list. */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::columnCategories + * \qmlproperty list ItemModelSurfaceDataProxy::columnCategories * The column categories of the mapping. Only items with column roles that are found in this list are * included when data is resolved. The columns are ordered in the same order as they are in this list. */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::useModelCategories + * \qmlproperty bool ItemModelSurfaceDataProxy::useModelCategories * When set to true, the mapping ignores row and column roles and categories, and uses * the rows and columns from the model instead. Defaults to \c{false}. */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::autoRowCategories + * \qmlproperty bool ItemModelSurfaceDataProxy::autoRowCategories * When set to true, the mapping ignores any explicitly set row categories * and overwrites them with automatically generated ones whenever the * data from model is resolved. Proxy minimum and maximum row values are also @@ -151,7 +151,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! - * \qmlproperty list ItemModelSurfaceDataProxy::autoColumnCategories + * \qmlproperty bool ItemModelSurfaceDataProxy::autoColumnCategories * When set to true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the * data from model is resolved. Proxy minimum and maximum column values are also -- cgit v1.2.3 From 6c7459083cd7854b726852eca0a69e8d935fbcc3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 11 Mar 2014 08:31:12 +0200 Subject: Minor doc fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If7e72625f5c78c6f153e63e2485dde1933c1dde8 Reviewed-by: Tomi Korpipää --- examples/datavisualization/bars/doc/src/bars.qdoc | 2 +- examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc | 2 +- examples/datavisualization/scatter/doc/src/scatter.qdoc | 2 +- examples/datavisualization/surface/doc/src/surface.qdoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/datavisualization/bars/doc/src/bars.qdoc b/examples/datavisualization/bars/doc/src/bars.qdoc index 58f6bdc4..361078bb 100644 --- a/examples/datavisualization/bars/doc/src/bars.qdoc +++ b/examples/datavisualization/bars/doc/src/bars.qdoc @@ -44,7 +44,7 @@ \snippet bars/main.cpp 0 - The call to QWidget::createWindowContainer is required, as all data visualization types + The call to QWidget::createWindowContainer is required, as all data visualization graph classes (Q3DBars, Q3DScatter, Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used as a widget any other way. diff --git a/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc b/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc index a3e7a5c5..b414225f 100644 --- a/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc +++ b/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc @@ -41,7 +41,7 @@ \snippet itemmodel/main.cpp 0 - The call to QWidget::createWindowContainer is required, as all data visualization types + The call to QWidget::createWindowContainer is required, as all data visualization graph classes (Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used as a widget any other way. diff --git a/examples/datavisualization/scatter/doc/src/scatter.qdoc b/examples/datavisualization/scatter/doc/src/scatter.qdoc index 3c9d72bc..c1eb9598 100644 --- a/examples/datavisualization/scatter/doc/src/scatter.qdoc +++ b/examples/datavisualization/scatter/doc/src/scatter.qdoc @@ -43,7 +43,7 @@ \snippet scatter/main.cpp 0 - The call to QWidget::createWindowContainer is required, as all data visualization types + The call to QWidget::createWindowContainer is required, as all data visualization graph classes (Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used as a widget any other way. diff --git a/examples/datavisualization/surface/doc/src/surface.qdoc b/examples/datavisualization/surface/doc/src/surface.qdoc index 14a04668..31b41c59 100644 --- a/examples/datavisualization/surface/doc/src/surface.qdoc +++ b/examples/datavisualization/surface/doc/src/surface.qdoc @@ -46,7 +46,7 @@ \snippet surface/main.cpp 0 - The call to QWidget::createWindowContainer is required, as all data visualization types + The call to QWidget::createWindowContainer is required, as all data visualization graph classes (Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used as a widget any other way. -- cgit v1.2.3 From 19eec1efb123279ad43a041ebd0cc2eaa752b27a Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Tue, 11 Mar 2014 13:02:31 +0200 Subject: Fix target name for mac bundle builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I34a0ca6be021e3acd22d2ec2079ff73c96f470e0 Reviewed-by: Tomi Korpipää Reviewed-by: Miikka Heikkinen --- src/datavisualization/datavisualization.pro | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/datavisualization/datavisualization.pro b/src/datavisualization/datavisualization.pro index ff87a2cd..44f0f60c 100644 --- a/src/datavisualization/datavisualization.pro +++ b/src/datavisualization/datavisualization.pro @@ -1,6 +1,11 @@ # Target can't start with 'Qt' as it gets major version number inserted into it in that case, -# which we don't want. -TARGET = DataVisualization +# which we don't want. Exception is mac bundles, where the target name must match the module name +mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { + TARGET = QtDataVisualization +} else { + TARGET = DataVisualization +} +message($$QT_CONFIG) QT = core gui DEFINES += QT_DATAVISUALIZATION_LIBRARY -- cgit v1.2.3 From 3ca866b2af83fe54000c54f8435ce7e47af6c819 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Mar 2014 09:57:26 +0200 Subject: Error out of building c++ examples in android or ios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7aeb6d1d779e94997f81f62d19113d5f211d3801 Reviewed-by: Tomi Korpipää --- examples/datavisualization/audiolevels/audiolevels.pro | 6 ++++++ examples/datavisualization/bars/bars.pro | 4 ++++ examples/datavisualization/custominput/custominput.pro | 4 ++++ examples/datavisualization/customproxy/customproxy.pro | 4 ++++ examples/datavisualization/itemmodel/itemmodel.pro | 4 ++++ examples/datavisualization/rotations/rotations.pro | 4 ++++ examples/datavisualization/scatter/scatter.pro | 4 ++++ examples/datavisualization/surface/surface.pro | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/examples/datavisualization/audiolevels/audiolevels.pro b/examples/datavisualization/audiolevels/audiolevels.pro index 73a68471..62565b7f 100644 --- a/examples/datavisualization/audiolevels/audiolevels.pro +++ b/examples/datavisualization/audiolevels/audiolevels.pro @@ -1,3 +1,9 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + +requires(qtHaveModule(multimedia)) + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/bars/bars.pro b/examples/datavisualization/bars/bars.pro index f2a1a2be..b432c0b9 100644 --- a/examples/datavisualization/bars/bars.pro +++ b/examples/datavisualization/bars/bars.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/custominput/custominput.pro b/examples/datavisualization/custominput/custominput.pro index 532a3f41..4c5526a4 100644 --- a/examples/datavisualization/custominput/custominput.pro +++ b/examples/datavisualization/custominput/custominput.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/customproxy/customproxy.pro b/examples/datavisualization/customproxy/customproxy.pro index cb9daccf..2f39aae5 100644 --- a/examples/datavisualization/customproxy/customproxy.pro +++ b/examples/datavisualization/customproxy/customproxy.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/itemmodel/itemmodel.pro b/examples/datavisualization/itemmodel/itemmodel.pro index c4caa3f2..d7f52780 100644 --- a/examples/datavisualization/itemmodel/itemmodel.pro +++ b/examples/datavisualization/itemmodel/itemmodel.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/rotations/rotations.pro b/examples/datavisualization/rotations/rotations.pro index fbad4271..e4541692 100644 --- a/examples/datavisualization/rotations/rotations.pro +++ b/examples/datavisualization/rotations/rotations.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/scatter/scatter.pro b/examples/datavisualization/scatter/scatter.pro index 7f676caa..8e8514b9 100644 --- a/examples/datavisualization/scatter/scatter.pro +++ b/examples/datavisualization/scatter/scatter.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } diff --git a/examples/datavisualization/surface/surface.pro b/examples/datavisualization/surface/surface.pro index 2858f875..fb70025f 100644 --- a/examples/datavisualization/surface/surface.pro +++ b/examples/datavisualization/surface/surface.pro @@ -1,3 +1,7 @@ +android|ios { + error( "This example is not supported for android or ios." ) +} + !include( ../examples.pri ) { error( "Couldn't find the examples.pri file!" ) } -- cgit v1.2.3 From 61c614240da9a2ecb5458e2796186339cbfd8762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 13 Mar 2014 09:40:44 +0200 Subject: SelectionMode as combination of checkboxes Change-Id: I30f697ae3f94258717f01b34813dc7fd66c2485c Reviewed-by: Miikka Heikkinen --- .../designer/Bars3DSpecifics.qml | 171 ++++++++++++++++++--- .../designer/Surface3DSpecifics.qml | 161 +++++++++++++++++-- 2 files changed, 292 insertions(+), 40 deletions(-) diff --git a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml index 55b06d97..e52320ac 100644 --- a/src/datavisualizationqml2/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Bars3DSpecifics.qml @@ -19,6 +19,7 @@ import QtQuick 2.0 import HelperWidgets 2.0 import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.1 as Controls Column { anchors.left: parent.left @@ -139,32 +140,152 @@ Column { Layout.fillWidth: true } SecondColumnLayout { - ComboBox { - backendValue: backendValues.selectionMode - model: [ - "SelectionNone", - "SelectionItem", - "SelectionRow", - "SelectionItemAndRow", - "SelectionColumn", - "SelectionItemAndColumn", - "SelectionRowAndColumn", - "SelectionItemRowAndColumn", - "SelectionRow | SelectionSlice", - "SelectionItemAndRow | SelectionSlice", - "SelectionColumn | SelectionSlice", - "SelectionItemAndColumn | SelectionSlice", - "SelectionRow | SelectionMultiSeries", - "SelectionItemAndRow | SelectionMultiSeries", - "SelectionColumn | SelectionMultiSeries", - "SelectionItemAndColumn | SelectionMultiSeries", - "SelectionRow | SelectionSlice | SelectionMultiSeries", - "SelectionItemAndRow | SelectionSlice | SelectionMultiSeries", - "SelectionColumn | SelectionSlice | SelectionMultiSeries", - "SelectionItemAndColumn | SelectionSlice | SelectionMultiSeries" - ] + id: selectionLayout + property bool isInModel: backendValue.isInModel; + property bool isInSubState: backendValue.isInSubState; + property bool selectionChangedFlag: selectionChanged + property variant backendValue: backendValues.selectionMode + property variant valueFromBackend: backendValue.value + property string enumScope: "AbstractGraph3D" + property string enumSeparator: " | " + property int checkedCount: 0 + property bool selectionItem: false + property bool selectionRow: false + property bool selectionColumn: false + property bool selectionSlice: false + property bool selectionMulti: false + + function checkValue(checkedVariable, variableText, expressionBase) { + var expressionStr = expressionBase + if (checkedVariable) { + if (expressionStr !== "") { + expressionStr += enumSeparator + } + expressionStr += enumScope + expressionStr += "." + expressionStr += variableText + checkedCount++ + } + return expressionStr + } + + function composeSelectionMode() { + var expressionStr = "" + checkedCount = 0 + expressionStr = checkValue(selectionItem, "SelectionItem", expressionStr) + expressionStr = checkValue(selectionRow, "SelectionRow", expressionStr) + expressionStr = checkValue(selectionColumn, "SelectionColumn", expressionStr) + expressionStr = checkValue(selectionSlice, "SelectionSlice", expressionStr) + expressionStr = checkValue(selectionMulti, "SelectionMultiSeries", expressionStr) + + if (checkedCount === 0) + backendValue.expression = enumScope + ".SelectionNone" + else + backendValue.expression = expressionStr + } + + function evaluate() { + if (backendValue.value === undefined) + return + + selectionItem = (backendValue.expression.indexOf("SelectionItem") !== -1) + selectionRow = (backendValue.expression.indexOf("SelectionRow") !== -1) + selectionColumn = (backendValue.expression.indexOf("SelectionColumn") !== -1) + selectionSlice = (backendValue.expression.indexOf("SelectionSlice") !== -1) + selectionMulti = (backendValue.expression.indexOf("SelectionMultiSeries") !== -1) + + selectionItemBox.checked = selectionItem + selectionRowBox.checked = selectionRow + selectionColumnBox.checked = selectionColumn + selectionSliceBox.checked = selectionSlice + selectionMultiSeriesBox.checked = selectionMulti + } + + onSelectionChangedFlagChanged: evaluate() + + onIsInModelChanged: evaluate() + + onIsInSubStateChanged: evaluate() + + onBackendValueChanged: evaluate() + + onValueFromBackendChanged: evaluate() + + ColumnLayout { + anchors.fill: parent + + Controls.CheckBox { + id: selectionItemBox + style: checkBox.style + text: "SelectionItem" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionItem = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionRowBox + style: checkBox.style + text: "SelectionRow" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionRow = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionColumnBox + style: checkBox.style + text: "SelectionColumn" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionColumn = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionSliceBox + style: checkBox.style + text: "SelectionSlice" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionSlice = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionMultiSeriesBox + style: checkBox.style + text: "SelectionMultiSeries" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionMulti = checked + selectionLayout.composeSelectionMode() + } + } + } + } + // Kept for debugging + Label { } + SecondColumnLayout { + TextEdit { + id: debugLabel Layout.fillWidth: true - scope: "AbstractGraph3D" + wrapMode: TextEdit.WordWrap + textFormat: TextEdit.RichText + width: 400 + visible: false + } + } + Controls.CheckBox { + property color textColor: colorLogic.textColor + id: checkBox + style: CustomCheckBoxStyle {} + visible: false + ColorLogic { + id: colorLogic + backendValue: backendValues.selectionMode } } } diff --git a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml index 7723e7ec..74470e4b 100644 --- a/src/datavisualizationqml2/designer/Surface3DSpecifics.qml +++ b/src/datavisualizationqml2/designer/Surface3DSpecifics.qml @@ -19,6 +19,7 @@ import QtQuick 2.0 import HelperWidgets 2.0 import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.1 as Controls Column { anchors.left: parent.left @@ -77,22 +78,152 @@ Column { Layout.fillWidth: true } SecondColumnLayout { - ComboBox { - backendValue: backendValues.selectionMode - model: [ - "SelectionNone", - "SelectionItem", - "SelectionRow | SelectionSlice", - "SelectionItemAndRow | SelectionSlice", - "SelectionColumn | SelectionSlice", - "SelectionItemAndColumn | SelectionSlice", - "SelectionRow | SelectionSlice | SelectionMultiSeries", - "SelectionItemAndRow | SelectionSlice | SelectionMultiSeries", - "SelectionColumn | SelectionSlice | SelectionMultiSeries", - "SelectionItemAndColumn | SelectionSlice | SelectionMultiSeries" - ] + id: selectionLayout + property bool isInModel: backendValue.isInModel; + property bool isInSubState: backendValue.isInSubState; + property bool selectionChangedFlag: selectionChanged + property variant backendValue: backendValues.selectionMode + property variant valueFromBackend: backendValue.value + property string enumScope: "AbstractGraph3D" + property string enumSeparator: " | " + property int checkedCount: 0 + property bool selectionItem: false + property bool selectionRow: false + property bool selectionColumn: false + property bool selectionSlice: false + property bool selectionMulti: false + + function checkValue(checkedVariable, variableText, expressionBase) { + var expressionStr = expressionBase + if (checkedVariable) { + if (expressionStr !== "") { + expressionStr += enumSeparator + } + expressionStr += enumScope + expressionStr += "." + expressionStr += variableText + checkedCount++ + } + return expressionStr + } + + function composeSelectionMode() { + var expressionStr = "" + checkedCount = 0 + expressionStr = checkValue(selectionItem, "SelectionItem", expressionStr) + expressionStr = checkValue(selectionRow, "SelectionRow", expressionStr) + expressionStr = checkValue(selectionColumn, "SelectionColumn", expressionStr) + expressionStr = checkValue(selectionSlice, "SelectionSlice", expressionStr) + expressionStr = checkValue(selectionMulti, "SelectionMultiSeries", expressionStr) + + if (checkedCount === 0) + backendValue.expression = enumScope + ".SelectionNone" + else + backendValue.expression = expressionStr + } + + function evaluate() { + if (backendValue.value === undefined) + return + + selectionItem = (backendValue.expression.indexOf("SelectionItem") !== -1) + selectionRow = (backendValue.expression.indexOf("SelectionRow") !== -1) + selectionColumn = (backendValue.expression.indexOf("SelectionColumn") !== -1) + selectionSlice = (backendValue.expression.indexOf("SelectionSlice") !== -1) + selectionMulti = (backendValue.expression.indexOf("SelectionMultiSeries") !== -1) + + selectionItemBox.checked = selectionItem + selectionRowBox.checked = selectionRow + selectionColumnBox.checked = selectionColumn + selectionSliceBox.checked = selectionSlice + selectionMultiSeriesBox.checked = selectionMulti + } + + onSelectionChangedFlagChanged: evaluate() + + onIsInModelChanged: evaluate() + + onIsInSubStateChanged: evaluate() + + onBackendValueChanged: evaluate() + + onValueFromBackendChanged: evaluate() + + ColumnLayout { + anchors.fill: parent + + Controls.CheckBox { + id: selectionItemBox + style: checkBox.style + text: "SelectionItem" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionItem = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionRowBox + style: checkBox.style + text: "SelectionRow" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionRow = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionColumnBox + style: checkBox.style + text: "SelectionColumn" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionColumn = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionSliceBox + style: checkBox.style + text: "SelectionSlice" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionSlice = checked + selectionLayout.composeSelectionMode() + } + } + Controls.CheckBox { + id: selectionMultiSeriesBox + style: checkBox.style + text: "SelectionMultiSeries" + Layout.fillWidth: true + onClicked: { + selectionLayout.selectionMulti = checked + selectionLayout.composeSelectionMode() + } + } + } + } + // Kept for debugging + Label { } + SecondColumnLayout { + TextEdit { + id: debugLabel Layout.fillWidth: true - scope: "AbstractGraph3D" + wrapMode: TextEdit.WordWrap + textFormat: TextEdit.RichText + width: 400 + visible: false + } + } + Controls.CheckBox { + property color textColor: colorLogic.textColor + id: checkBox + style: CustomCheckBoxStyle {} + visible: false + ColorLogic { + id: colorLogic + backendValue: backendValues.selectionMode } } } -- cgit v1.2.3