diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-29 14:01:42 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-30 10:06:08 +0200 |
commit | 84c156d3e2fcceeab608f401fbc638f2d01219b3 (patch) | |
tree | 74de2de1635c60645f4864d08f6afb941948aea8 /src/datavisualization/engine/q3dsurface.cpp | |
parent | 233d5c02638903e96687d580ada7188f0e6a9756 (diff) |
Selection overhaul
Selection modes are now proper flags, so you can easily mix and match
item, row, and column modes as you wish. Slice flag means automatic
slicing control - if user wishes to control slicing himself, he should
not set this mode flag.
Clicking an item on graph now emits clicked signal from renderer to
controller on all graphs instead of setting the selected item.
Controller will set the selected item based on this information.
Task-number: QTRD-2366
Task-number: QTRD-2491
Change-Id: I6251c42e22ea676613fbd36685e33574e6eb9a1a
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/engine/q3dsurface.cpp')
-rw-r--r-- | src/datavisualization/engine/q3dsurface.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/datavisualization/engine/q3dsurface.cpp b/src/datavisualization/engine/q3dsurface.cpp index 42260e8b..7b9e32bb 100644 --- a/src/datavisualization/engine/q3dsurface.cpp +++ b/src/datavisualization/engine/q3dsurface.cpp @@ -101,6 +101,8 @@ Q3DSurface::Q3DSurface() { setVisualController(d_ptr->m_shared); d_ptr->m_shared->initializeOpenGL(); + QObject::connect(d_ptr->m_shared, &Surface3DController::selectedPointChanged, this, + &Q3DSurface::selectedPointChanged); QObject::connect(d_ptr->m_shared, &Abstract3DController::needRender, this, &Q3DWindow::renderLater); } @@ -260,15 +262,16 @@ bool Q3DSurface::isSmoothSurfaceEnabled() const /*! * \property Q3DSurface::selectionMode * - * Sets point selection \a mode to one of \c QDataVis::SelectionMode. Surface supports SelectionModeItem, - * SelectionModeSliceRow and SelectionModeSliceColumn. It is preset to \c QDataVis::SelectionModeItem by default. + * Sets point selection \a mode to one of \c QDataVis::SelectionMode. Surface supports + * \c SelectionItem and \c SelectionSlice with either \c SelectionRow or \c SelectionColumn. + * It is preset to \c SelectionItem by default. */ -void Q3DSurface::setSelectionMode(QDataVis::SelectionMode mode) +void Q3DSurface::setSelectionMode(QDataVis::SelectionFlags mode) { d_ptr->m_shared->setSelectionMode(mode); } -QDataVis::SelectionMode Q3DSurface::selectionMode() const +QDataVis::SelectionFlags Q3DSurface::selectionMode() const { return d_ptr->m_shared->selectionMode(); } @@ -331,6 +334,24 @@ Q3DScene *Q3DSurface::scene() const } /*! + * \property Q3DSurface::selectedPoint + * + * Selects a surface grid point in a \a position. The position is the (row, column) position in + * the data array of the active data proxy. + * Only one point can be selected at a time. + * To clear selection, specify an illegal \a position, e.g. (-1, -1). + */ +void Q3DSurface::setSelectedPoint(const QPoint &position) +{ + d_ptr->m_shared->setSelectedPoint(position); +} + +QPoint Q3DSurface::selectedPoint() const +{ + return d_ptr->m_shared->selectedPoint(); +} + +/*! * \property Q3DSurface::labelStyle * * Sets label \a style to one of \c QDataVis::LabelStyle. It is preset to |