QAbstract3DInputHandler Class

The base class for implementations of input handlers. More...

Header: #include <QAbstract3DInputHandler>
Since: QtDataVisualization 1.0
Instantiated By: AbstractInputHandler3D
Inherits: QObject
Inherited By:

Q3DInputHandler

Public Types

enum InputView { InputViewNone, InputViewOnPrimary, InputViewOnSecondary }

Properties

  • 1 property inherited from QObject

Public Functions

virtual ~QAbstract3DInputHandler()
QPoint inputPosition() const
InputView inputView() const
virtual void mouseDoubleClickEvent(QMouseEvent *event)
virtual void mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos)
virtual void mousePressEvent(QMouseEvent *event, const QPoint &mousePos)
virtual void mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos)
Q3DScene *scene() const
void setInputPosition(const QPoint &position)
void setInputView(InputView inputView)
void setScene(Q3DScene *scene)
virtual void touchEvent(QTouchEvent *event)
virtual void wheelEvent(QWheelEvent *event)
  • 31 public functions inherited from QObject

Signals

void inputViewChanged(QAbstract3DInputHandler::InputView view)
void positionChanged(const QPoint &position)
void sceneChanged(Q3DScene *scene)

Protected Functions

QAbstract3DInputHandler(QObject *parent = Q_NULLPTR)
int prevDistance() const
QPoint previousInputPos() const
void setPrevDistance(int distance)
void setPreviousInputPos(const QPoint &position)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject

Detailed Description

The base class for implementations of input handlers.

QAbstract3DInputHandler is the base class that is subclassed by different input handling implementations that take input events and translate those to camera and light movements. Input handlers also translate raw input events to slicing and selection events in the scene.

Member Type Documentation

enum QAbstract3DInputHandler::InputView

Predefined input views for mouse and touch based input handlers.

ConstantValueDescription
QAbstract3DInputHandler::InputViewNone0Mouse or touch not on a view.
QAbstract3DInputHandler::InputViewOnPrimary1Mouse or touch input received on the primary view area. If secondary view is displayed when inputView becomes InputViewOnPrimary, secondary view is closed.
QAbstract3DInputHandler::InputViewOnSecondary2Mouse or touch input received on the secondary view area.

Property Documentation

inputPosition : QPoint

Last input position based on the processed input events.

Access functions:

QPoint inputPosition() const
void setInputPosition(const QPoint &position)

Notifier signal:

void positionChanged(const QPoint &position)

inputView : InputView

Current enumerated input view based on the view of the processed input events. When the view changes inputViewChanged signal is emitted.

Access functions:

InputView inputView() const
void setInputView(InputView inputView)

Notifier signal:

void inputViewChanged(QAbstract3DInputHandler::InputView view)

scene : Q3DScene *

The 3D scene this abstract input handler is controlling. Only one scene can be controlled by one input handler. Setting a scene to an input handler doesn't transfer the ownership of the scene.

Access functions:

Q3DScene *scene() const
void setScene(Q3DScene *scene)

Notifier signal:

void sceneChanged(Q3DScene *scene)

Member Function Documentation

[protected] QAbstract3DInputHandler::QAbstract3DInputHandler(QObject *parent = Q_NULLPTR)

Constructs the base class. An optional parent parameter can be given and is then passed to QObject constructor.

[virtual] QAbstract3DInputHandler::~QAbstract3DInputHandler()

Destroys the base class.

[virtual] void QAbstract3DInputHandler::mouseDoubleClickEvent(QMouseEvent *event)

Override this to handle mouse double click events. Mouse double click event is given in the event.

[virtual] void QAbstract3DInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos)

Override this to handle mouse move events. Mouse move event is given in the event and the mouse position in mousePos.

[virtual] void QAbstract3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos)

Override this to handle mouse press events. Mouse press event is given in the event and the mouse position in mousePos.

[virtual] void QAbstract3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos)

Override this to handle mouse release events. Mouse release event is given in the event and the mouse position in mousePos.

[protected] int QAbstract3DInputHandler::prevDistance() const

Returns the manhattan length between last two input positions.

See also setPrevDistance().

[protected] QPoint QAbstract3DInputHandler::previousInputPos() const

Returns the previous input position. Returns Previous input position.

See also setPreviousInputPos().

[protected] void QAbstract3DInputHandler::setPrevDistance(int distance)

Sets the distance (manhattan length) between last two input positions.

See also prevDistance().

[protected] void QAbstract3DInputHandler::setPreviousInputPos(const QPoint &position)

Sets the previous input position to the point given by position.

See also previousInputPos().

[virtual] void QAbstract3DInputHandler::touchEvent(QTouchEvent *event)

Override this to handle touch input events. Touch event is given in the event.

[virtual] void QAbstract3DInputHandler::wheelEvent(QWheelEvent *event)

Override this to handle wheel events. Wheel event is given in the event.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.