diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-05-13 06:22:30 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-05-13 08:08:21 +0300 |
commit | e5c7d46ba8c817e663d373fda191662b3276fdc6 (patch) | |
tree | bad6aad73a0dd016096e6ef0e86f5d1286115b7d /src/datavisualization/engine/bars3drenderer.cpp | |
parent | 3d7f8820a86a4852fe2df27df53b745cfa32eb94 (diff) |
Added API for querying label selection
Task-number: QTRD-3045
Change-Id: Ib5c8f29bcf0148ae604e27b2a81e6f72a2dbca2a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualization/engine/bars3drenderer.cpp')
-rw-r--r-- | src/datavisualization/engine/bars3drenderer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index a6f893e5..bf381754 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -2269,6 +2269,7 @@ QPoint Bars3DRenderer::selectionColorToArrayPosition(const QVector4D &selectionC { QPoint position = Bars3DController::invalidSelectionPosition(); m_clickedType = QAbstract3DGraph::ElementNone; + m_selectedLabelIndex = -1; if (selectionColor.w() == itemAlpha) { // Normal selection item position = QPoint(int(selectionColor.x() + int(m_axisCacheZ.min())), @@ -2282,6 +2283,7 @@ QPoint Bars3DRenderer::selectionColorToArrayPosition(const QVector4D &selectionC GLint previousCol = qMax(0, m_selectedBarPos.y()); // Use 0 if previous is invalid position = QPoint(int(selectionColor.x() + int(m_axisCacheZ.min())), previousCol); } + m_selectedLabelIndex = selectionColor.x(); // Pass label clicked info to input handler m_clickedType = QAbstract3DGraph::ElementAxisZLabel; } else if (selectionColor.w() == labelColumnAlpha) { @@ -2291,11 +2293,13 @@ QPoint Bars3DRenderer::selectionColorToArrayPosition(const QVector4D &selectionC GLint previousRow = qMax(0, m_selectedBarPos.x()); // Use 0 if previous is invalid position = QPoint(previousRow, int(selectionColor.y()) + int(m_axisCacheX.min())); } + m_selectedLabelIndex = selectionColor.y(); // Pass label clicked info to input handler m_clickedType = QAbstract3DGraph::ElementAxisXLabel; } else if (selectionColor.w() == labelValueAlpha) { // Value selection position = Bars3DController::invalidSelectionPosition(); + m_selectedLabelIndex = selectionColor.z(); // Pass label clicked info to input handler m_clickedType = QAbstract3DGraph::ElementAxisYLabel; } else if (selectionColor.w() == customItemAlpha) { |