From e5c7d46ba8c817e663d373fda191662b3276fdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 13 May 2014 06:22:30 +0300 Subject: Added API for querying label selection Task-number: QTRD-3045 Change-Id: Ib5c8f29bcf0148ae604e27b2a81e6f72a2dbca2a Reviewed-by: Miikka Heikkinen --- src/datavisualization/engine/qabstract3dgraph.cpp | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/datavisualization/engine/qabstract3dgraph.cpp') diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index 85ee79c9..13d7972a 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -426,6 +426,32 @@ void QAbstract3DGraph::removeCustomItemAt(const QVector3D &position) d_ptr->m_visualController->deleteCustomItem(position); } +/*! + * Can be used to query the index of the selected label after receiving elementSelected signal with + * any label type. Selection is valid until the next elementSelected signal. + * + * \return index of the selected label, or -1. + * + * \since Qt Data Visualization 1.1 + */ +int QAbstract3DGraph::selectedLabelIndex() const +{ + return d_ptr->m_visualController->selectedLabelIndex(); +} + +/*! + * Can be used to get the selected axis after receiving elementSelected signal with any label type. + * Selection is valid until the next elementSelected signal. + * + * \return pointer to the selected axis, or null. + * + * \since Qt Data Visualization 1.1 + */ +QAbstract3DAxis *QAbstract3DGraph::selectedAxis() const +{ + return d_ptr->m_visualController->selectedAxis(); +} + /*! * Renders current frame to an image of \a imageSize. Default size is the window size. Image is * rendered with antialiasing level given in \a msaaSamples. Default level is \c{0}. @@ -449,6 +475,8 @@ QImage QAbstract3DGraph::renderToImage(int msaaSamples, const QSize &imageSize) * * Signal can be used for example for implementing custom input handlers, as demonstrated in this * \l {Axis Range Dragging With Labels Example}{example}. + * + * \sa selectedLabelIndex(), selectedAxis() */ /*! -- cgit v1.2.3