summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/surface3dcontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/datavisualization/engine/surface3dcontroller.cpp')
-rw-r--r--src/datavisualization/engine/surface3dcontroller.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/datavisualization/engine/surface3dcontroller.cpp b/src/datavisualization/engine/surface3dcontroller.cpp
index ca546a74..c69ad5bd 100644
--- a/src/datavisualization/engine/surface3dcontroller.cpp
+++ b/src/datavisualization/engine/surface3dcontroller.cpp
@@ -70,8 +70,7 @@ void Surface3DController::initializeOpenGL()
m_renderer = new Surface3DRenderer(this);
setRenderer(m_renderer);
synchDataToRenderer();
- QObject::connect(m_renderer, &Surface3DRenderer::pointClicked, this,
- &Surface3DController::handlePointClicked, Qt::QueuedConnection);
+
emitNeedRender();
}
@@ -128,6 +127,19 @@ void Surface3DController::handleSeriesVisibilityChangedBySender(QObject *sender)
setSelectedPoint(m_selectedPoint, m_selectedSeries);
}
+void Surface3DController::handlePendingClick()
+{
+ // This function is called while doing the sync, so it is okay to query from renderer
+ QPoint position = m_renderer->clickedPosition();
+ QSurface3DSeries *series = static_cast<QSurface3DSeries *>(m_renderer->clickedSeries());
+
+ // TODO: Adjust position according to inserts/removes in the series
+
+ setSelectedPoint(position, series);
+
+ m_renderer->resetClickedStatus();
+}
+
QPoint Surface3DController::invalidSelectionPosition()
{
static QPoint invalidSelectionPoint(-1, -1);
@@ -297,13 +309,6 @@ void Surface3DController::handleArrayReset()
emitNeedRender();
}
-void Surface3DController::handlePointClicked(const QPoint &position, QSurface3DSeries *series)
-{
- setSelectedPoint(position, series);
- // TODO: pass clicked to parent. (QTRD-2517)
- // TODO: Also hover needed? (QTRD-2131)
-}
-
void Surface3DController::handleFlatShadingSupportedChange(bool supported)
{
// Handle renderer flat surface support indicator signal. This happens exactly once per renderer.