From 1b1dfcaadf83c73d3f7c1c1cd893894a3aea0ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Tue, 21 Jan 2014 12:01:27 +0200 Subject: InputState enum divided Task-number: QTRD-2683 Change-Id: Ib05469ac1bf8c8ed828974a3adb91ecb5f8f1fc9 Reviewed-by: Miikka Heikkinen --- .../input/qabstract3dinputhandler.cpp | 39 ++++++++++++++++++---- 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'src/datavisualization/input/qabstract3dinputhandler.cpp') diff --git a/src/datavisualization/input/qabstract3dinputhandler.cpp b/src/datavisualization/input/qabstract3dinputhandler.cpp index a0811f5b..a369a054 100644 --- a/src/datavisualization/input/qabstract3dinputhandler.cpp +++ b/src/datavisualization/input/qabstract3dinputhandler.cpp @@ -38,18 +38,25 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * * \value InputStateNone * Default "no input received" state. - * \value InputStateOnScene - * Mouse or touch input received on the 3D scene. - * \value InputStateOnPrimaryView - * Mouse or touch input received on the primary view area. - * \value InputStateOnSecondaryView - * Mouse or touch input received on the secondary view area. * \value InputStateRotating * Rotation of the 3D geometry ongoing. * \value InputStatePinching * Pinch/punch multitouch input ongoing. */ +/*! + * \enum QAbstract3DInputHandler::InputView + * + * Predefined input views for mouse and touch based input handlers. + * + * \value InputViewNone + * Mouse or touch not on a view. + * \value InputViewOnPrimary + * Mouse or touch input received on the primary view area. + * \value InputViewOnSecondary + * Mouse or touch input received on the secondary view area. + */ + /*! * \qmltype AbstractInputHandler3D * \inqmlmodule QtDataVisualization @@ -158,6 +165,25 @@ void QAbstract3DInputHandler::setInputState(InputState inputState) } } +/*! + * \property QAbstract3DInputHandler::inputView + * + * Current enumerated input view based on the view of the processed input events. + * When the view changes inputViewChanged() is emitted. + */ +QAbstract3DInputHandler::InputView QAbstract3DInputHandler::inputView() +{ + return d_ptr->m_inputView; +} + +void QAbstract3DInputHandler::setInputView(InputView inputView) +{ + if (inputView != d_ptr->m_inputView) { + d_ptr->m_inputView = inputView; + emit inputViewChanged(inputView); + } +} + /*! * \property QAbstract3DInputHandler::inputPosition * @@ -234,6 +260,7 @@ QAbstract3DInputHandlerPrivate::QAbstract3DInputHandlerPrivate(QAbstract3DInputH m_prevDistance(0), m_previousInputPos(QPoint(0,0)), m_inputState(QAbstract3DInputHandler::InputStateNone), + m_inputView(QAbstract3DInputHandler::InputViewNone), m_inputPosition(QPoint(0,0)), m_scene(0) { -- cgit v1.2.3