summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/axis/qvalue3daxis.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-05-06 09:52:24 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-05-08 08:37:17 +0300
commit8ff45fe94c3f3f6916f8f673c3ce0b574a69cfdf (patch)
tree8a085097595201ad14a0afcdd794f75feb365e89 /src/datavisualization/axis/qvalue3daxis.cpp
parentd6c1aadb3ee366ce8fd40da43fb65128ab3b2d44 (diff)
Value axis reversing support
Task-number: QTRD-2428 Change-Id: I51b3a1f8f974d5b72b36ee1188b7557539b9609b Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'src/datavisualization/axis/qvalue3daxis.cpp')
-rw-r--r--src/datavisualization/axis/qvalue3daxis.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/datavisualization/axis/qvalue3daxis.cpp b/src/datavisualization/axis/qvalue3daxis.cpp
index 79d374ea..1c7b647a 100644
--- a/src/datavisualization/axis/qvalue3daxis.cpp
+++ b/src/datavisualization/axis/qvalue3daxis.cpp
@@ -83,6 +83,15 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*/
/*!
+ * \qmlproperty bool ValueAxis3D::reversed
+ * \since QtDataVisualization 1.1
+ *
+ * If \c{true}, the axis will be rendered in reverse, i.e. the positions of minimum and maximum
+ * values are swapped when the graph is rendered. This property doesn't affect the actual
+ * minimum and maximum values of the axis.
+ */
+
+/*!
* Constructs QValue3DAxis with the given \a parent.
*/
QValue3DAxis::QValue3DAxis(QObject *parent) :
@@ -204,6 +213,27 @@ QValue3DAxisFormatter *QValue3DAxis::formatter() const
}
/*!
+ * \property QValue3DAxis::reversed
+ * \since Qt Data Visualization 1.1
+ *
+ * If \c{true}, the axis will be rendered in reverse, i.e. the positions of minimum and maximum
+ * values are swapped when the graph is rendered. This property doesn't affect the actual
+ * minimum and maximum values of the axis.
+ */
+void QValue3DAxis::setReversed(bool enable)
+{
+ if (dptr()->m_reversed != enable) {
+ dptr()->m_reversed = enable;
+ emit reversedChanged(enable);
+ }
+}
+
+bool QValue3DAxis::reversed() const
+{
+ return dptrc()->m_reversed;
+}
+
+/*!
* \internal
*/
QValue3DAxisPrivate *QValue3DAxis::dptr()
@@ -225,7 +255,8 @@ QValue3DAxisPrivate::QValue3DAxisPrivate(QValue3DAxis *q)
m_subSegmentCount(1),
m_labelFormat(Utils::defaultLabelFormat()),
m_labelsDirty(true),
- m_formatter(0)
+ m_formatter(0),
+ m_reversed(false)
{
}