diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-05-23 16:06:28 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-05-27 10:23:53 +0300 |
commit | d9cb05d0f46efc58e508c233a3c67542a4c177fa (patch) | |
tree | 326badf5c83c5fac683e84819de902d88cd534ee /src/datavisualization/axis/qabstract3daxis.cpp | |
parent | 1da51fd24458710d6b740feaba73c21fe2b1273a (diff) |
Optionally show axis titles on the graph
Task-number: QTRD-2961
Change-Id: I6a344156bd29fa8fb1ede0546af4d0e67e5e2db4
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/axis/qabstract3daxis.cpp')
-rw-r--r-- | src/datavisualization/axis/qabstract3daxis.cpp | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/src/datavisualization/axis/qabstract3daxis.cpp b/src/datavisualization/axis/qabstract3daxis.cpp index 27951f4c..681c435f 100644 --- a/src/datavisualization/axis/qabstract3daxis.cpp +++ b/src/datavisualization/axis/qabstract3daxis.cpp @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION /*! * \qmlproperty string AbstractAxis3D::title * Defines the title for the axis. + * + * \sa titleVisible, titleFixed */ /*! @@ -100,6 +102,27 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION */ /*! + * \qmlproperty bool AbstractAxis3D::titleVisible + * + * Defines if the axis title is visible in the primary graph view. The default value is \c{false}. + * + * \sa title, titleFixed + */ + +/*! + * \qmlproperty bool AbstractAxis3D::titleFixed + * + * If \c{true}, axis titles in the primary graph view will be rotated towards the camera similarly + * to the axis labels. + * If \c{false}, axis titles are only rotated around their axis but are not otherwise oriented + * towards the camera. + * This property doesn't have any effect if labelAutoRotation property value is zero. + * Default value is \c{true}. + * + * \sa labelAutoRotation, title, titleVisible + */ + +/*! * \enum QAbstract3DAxis::AxisOrientation * * The orientation of the axis object. @@ -160,6 +183,8 @@ QAbstract3DAxis::AxisType QAbstract3DAxis::type() const * \property QAbstract3DAxis::title * * Defines the title for the axis. + * + * \sa titleVisible, titleFixed */ void QAbstract3DAxis::setTitle(const QString &title) { @@ -229,6 +254,51 @@ float QAbstract3DAxis::labelAutoRotation() const } /*! + * \property QAbstract3DAxis::titleVisible + * + * Defines if the axis title is visible in the primary graph view. The default value is \c{false}. + * + * \sa title, titleFixed + */ +void QAbstract3DAxis::setTitleVisible(bool visible) +{ + if (d_ptr->m_titleVisible != visible) { + d_ptr->m_titleVisible = visible; + emit titleVisibilityChanged(visible); + } +} + +bool QAbstract3DAxis::isTitleVisible() const +{ + return d_ptr->m_titleVisible; +} + +/*! + * \property QAbstract3DAxis::titleFixed + * + * If \c{true}, axis titles in the primary graph view will be rotated towards the camera similarly + * to the axis labels. + * If \c{false}, axis titles are only rotated around their axis but are not otherwise oriented + * towards the camera. + * This property doesn't have any effect if labelAutoRotation property value is zero. + * Default value is \c{true}. + * + * \sa labelAutoRotation, title, titleVisible + */ +void QAbstract3DAxis::setTitleFixed(bool fixed) +{ + if (d_ptr->m_titleFixed != fixed) { + d_ptr->m_titleFixed = fixed; + emit titleFixedChanged(fixed); + } +} + +bool QAbstract3DAxis::isTitleFixed() const +{ + return d_ptr->m_titleFixed; +} + +/*! * \property QAbstract3DAxis::min * * Defines the minimum value on the axis. @@ -302,7 +372,9 @@ QAbstract3DAxisPrivate::QAbstract3DAxisPrivate(QAbstract3DAxis *q, QAbstract3DAx m_min(0.0f), m_max(10.0f), m_autoAdjust(true), - m_labelAutoRotation(0.0f) + m_labelAutoRotation(0.0f), + m_titleVisible(false), + m_titleFixed(true) { } |