summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/qabstract3dgraph.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-05-13 08:26:06 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-05-13 08:40:48 +0300
commit604d8a652cc088a4b3a4307ec291916757e03201 (patch)
tree23ef89627b1bad166a8d9d611fee2cff9b8ac2bd /src/datavisualization/engine/qabstract3dgraph.cpp
parente5c7d46ba8c817e663d373fda191662b3276fdc6 (diff)
API to query custom item selection
Task-number: QTRD-3046 + Added missing elementSelected signal to QML Change-Id: I5e79d8e910d2730e3d2ae5550ce576f01aac0b18 Change-Id: I5e79d8e910d2730e3d2ae5550ce576f01aac0b18 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualization/engine/qabstract3dgraph.cpp')
-rw-r--r--src/datavisualization/engine/qabstract3dgraph.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp
index 13d7972a..f2942026 100644
--- a/src/datavisualization/engine/qabstract3dgraph.cpp
+++ b/src/datavisualization/engine/qabstract3dgraph.cpp
@@ -453,6 +453,34 @@ QAbstract3DAxis *QAbstract3DGraph::selectedAxis() const
}
/*!
+ * Can be used to query the index of the selected custom item after receiving elementSelected signal
+ * with QAbstract3DGraph::ElementCustomItem type. Selection is valid until the next elementSelected
+ * signal.
+ *
+ * \return index of the selected custom item, or -1.
+ *
+ * \since Qt Data Visualization 1.1
+ */
+int QAbstract3DGraph::selectedCustomItemIndex() const
+{
+ return d_ptr->m_visualController->selectedCustomItemIndex();
+}
+
+/*!
+ * Can be used to get the selected custom item after receiving elementSelected signal with
+ * QAbstract3DGraph::ElementCustomItem type. Ownership of the item remains with the graph.
+ * Selection is valid until the next elementSelected signal.
+ *
+ * \return pointer to the selected custom item, or null.
+ *
+ * \since Qt Data Visualization 1.1
+ */
+QCustom3DItem *QAbstract3DGraph::selectedCustomItem() const
+{
+ return d_ptr->m_visualController->selectedCustomItem();
+}
+
+/*!
* 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}.
*
@@ -476,7 +504,7 @@ 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()
+ * \sa selectedLabelIndex(), selectedAxis(), selectedCustomItemIndex(), selectedCustomItem()
*/
/*!