From 1b311517f8889e6faa8a1ae51af582c1cd07e739 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 4 Jul 2014 12:14:13 +0300 Subject: Exposed default input handlers to QML Also added properties to control rotation, zoom, and selection individually. Also added missing documentation about surface texture. Task-number: QTRD-3202 Change-Id: I981edb7f336aea499440559f4a2098711200206d Reviewed-by: Mika Salmela --- src/datavisualization/input/q3dinputhandler.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/datavisualization/input/q3dinputhandler.h') diff --git a/src/datavisualization/input/q3dinputhandler.h b/src/datavisualization/input/q3dinputhandler.h index 118bd829..9afeb945 100644 --- a/src/datavisualization/input/q3dinputhandler.h +++ b/src/datavisualization/input/q3dinputhandler.h @@ -28,17 +28,32 @@ class Q3DInputHandlerPrivate; class QT_DATAVISUALIZATION_EXPORT Q3DInputHandler : public QAbstract3DInputHandler { Q_OBJECT + Q_PROPERTY(bool rotationEnabled READ isRotationEnabled WRITE setRotationEnabled NOTIFY rotationEnabledChanged) + Q_PROPERTY(bool zoomEnabled READ isZoomEnabled WRITE setZoomEnabled NOTIFY zoomEnabledChanged) + Q_PROPERTY(bool selectionEnabled READ isSelectionEnabled WRITE setSelectionEnabled NOTIFY selectionEnabledChanged) public: explicit Q3DInputHandler(QObject *parent = 0); virtual ~Q3DInputHandler(); + void setRotationEnabled(bool enable); + bool isRotationEnabled() const; + void setZoomEnabled(bool enable); + bool isZoomEnabled() const; + void setSelectionEnabled(bool enable); + bool isSelectionEnabled() const; + // Input event listeners virtual void mousePressEvent(QMouseEvent *event, const QPoint &mousePos); virtual void mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos); virtual void mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos); virtual void wheelEvent(QWheelEvent *event); +signals: + void rotationEnabledChanged(bool enable); + void zoomEnabledChanged(bool enable); + void selectionEnabledChanged(bool enable); + private: Q_DISABLE_COPY(Q3DInputHandler) -- cgit v1.2.3